]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
ike-mobike: Support IKE_AUX exchange between IKE_SA_INIT and IKE_AUTH
authorTobias Brunner <tobias@strongswan.org>
Mon, 25 Jun 2018 12:03:56 +0000 (14:03 +0200)
committerTobias Brunner <tobias@strongswan.org>
Tue, 14 May 2019 08:44:19 +0000 (10:44 +0200)
This changes the MID of the first IKE_AUTH message.

src/libcharon/sa/ikev2/tasks/ike_mobike.c

index b2ad0a02afcd7ea7aae98aeeb019e80a90d223a6..a9ac805893251de7efd9348af8df11ad38af1bb4 100644 (file)
@@ -414,11 +414,12 @@ METHOD(ike_mobike_t, transmit, bool,
 METHOD(task_t, build_i, status_t,
           private_ike_mobike_t *this, message_t *message)
 {
-       if (message->get_exchange_type(message) == IKE_AUTH &&
-               message->get_message_id(message) == 1)
-       {       /* only in first IKE_AUTH */
+       if (message->get_exchange_type(message) == IKE_AUTH)
+       {
                message->add_notify(message, FALSE, MOBIKE_SUPPORTED, chunk_empty);
                build_address_list(this, message);
+               /* only in first IKE_AUTH */
+               this->public.task.build = (void*)return_need_more;
        }
        else if (message->get_exchange_type(message) == INFORMATIONAL)
        {
@@ -465,10 +466,11 @@ METHOD(task_t, build_i, status_t,
 METHOD(task_t, process_r, status_t,
           private_ike_mobike_t *this, message_t *message)
 {
-       if (message->get_exchange_type(message) == IKE_AUTH &&
-               message->get_message_id(message) == 1)
-       {       /* only first IKE_AUTH */
+       if (message->get_exchange_type(message) == IKE_AUTH)
+       {
                process_payloads(this, message);
+               /* only first IKE_AUTH */
+               this->public.task.process = (void*)return_need_more;
        }
        else if (message->get_exchange_type(message) == INFORMATIONAL)
        {
@@ -509,7 +511,7 @@ METHOD(task_t, build_r, status_t,
 {
        if (message->get_exchange_type(message) == IKE_AUTH &&
                this->ike_sa->get_state(this->ike_sa) == IKE_ESTABLISHED)
-       {
+       {       /* in last IKE_AUTH only */
                if (this->ike_sa->supports_extension(this->ike_sa, EXT_MOBIKE))
                {
                        message->add_notify(message, FALSE, MOBIKE_SUPPORTED, chunk_empty);
@@ -542,7 +544,7 @@ METHOD(task_t, process_i, status_t,
 {
        if (message->get_exchange_type(message) == IKE_AUTH &&
                this->ike_sa->get_state(this->ike_sa) == IKE_ESTABLISHED)
-       {
+       {       /* in last IKE_AUTH only */
                process_payloads(this, message);
                return SUCCESS;
        }