ike-auth: Don't send INITIAL_CONTACT if remote ID contains wildcards
[strongswan.git] / src / libcharon / sa / ikev2 / tasks / ike_auth.c
index 036910d..1e47144 100644 (file)
@@ -466,7 +466,8 @@ METHOD(task_t, build_i, status_t,
                get_reserved_id_bytes(this, id_payload);
                message->add_payload(message, (payload_t*)id_payload);
 
-               if (idr && message->get_message_id(message) == 1 &&
+               if (idr && !idr->contains_wildcards(idr) &&
+                       message->get_message_id(message) == 1 &&
                        this->peer_cfg->get_unique_policy(this->peer_cfg) != UNIQUE_NO &&
                        this->peer_cfg->get_unique_policy(this->peer_cfg) != UNIQUE_NEVER)
                {