]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
ikev2: Don't destroy the SA if an IKE_SA_INIT with unexpected MID is received
authorTobias Brunner <tobias@strongswan.org>
Wed, 25 Feb 2015 07:18:58 +0000 (08:18 +0100)
committerTobias Brunner <tobias@strongswan.org>
Wed, 4 Mar 2015 12:47:53 +0000 (13:47 +0100)
This reverts 8f727d800751 ("Clean up IKE_SA state if IKE_SA_INIT request
does not have message ID 0") because it allowed to close any IKE_SA by
sending an IKE_SA_INIT with an unexpected MID and both SPIs set to those
of that SA.

The next commit will prevent SAs from getting created for IKE_SA_INIT messages
with invalid MID.

Fixes #816.

src/libcharon/sa/ikev2/task_manager_v2.c

index 48266aa52517044141cf81966bd2faf44eb362d5..be84e712a1f5411956c19b35e0ee29bb50128fbd 100644 (file)
@@ -1355,10 +1355,6 @@ METHOD(task_manager_t, process_message, status_t,
                {
                        DBG1(DBG_IKE, "received message ID %d, expected %d. Ignored",
                                 mid, this->responding.mid);
-                       if (msg->get_exchange_type(msg) == IKE_SA_INIT)
-                       {       /* clean up IKE_SA state if IKE_SA_INIT has invalid msg ID */
-                               return DESTROY_ME;
-                       }
                }
        }
        else