diff options
author | Tobias Brunner <tobias@strongswan.org> | 2016-10-04 15:15:36 +0200 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2017-02-08 15:03:26 +0100 |
commit | c3d98d298ec2238a8a76694587fa1f36b5a1e14c (patch) | |
tree | ac2028a2a609ab73b5de9b2e1f1c362623455b6f /src/libcharon/sa/ikev2/tasks/ike_mid_sync.c | |
parent | fb57904cbffefcfdacedac59676115062d77c37a (diff) | |
download | strongswan-c3d98d298ec2238a8a76694587fa1f36b5a1e14c.tar.bz2 strongswan-c3d98d298ec2238a8a76694587fa1f36b5a1e14c.tar.xz |
ikev2: Don't increase expected MID after handling MID sync message
If the responder never sent a message the expected MID is 0. While
the sent MID (M1) SHOULD be increased beyond the known value, it's
not necessarily the case.
Since M2 - 1 would then equal UINT_MAX setting that MID would get ignored
and while we'd return 0 in the notify we'd actually expect 1 afterwards.
Diffstat (limited to 'src/libcharon/sa/ikev2/tasks/ike_mid_sync.c')
-rw-r--r-- | src/libcharon/sa/ikev2/tasks/ike_mid_sync.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/libcharon/sa/ikev2/tasks/ike_mid_sync.c b/src/libcharon/sa/ikev2/tasks/ike_mid_sync.c index 9967697dd..d7de11303 100644 --- a/src/libcharon/sa/ikev2/tasks/ike_mid_sync.c +++ b/src/libcharon/sa/ikev2/tasks/ike_mid_sync.c @@ -180,9 +180,7 @@ METHOD(task_t, process, status_t, m2 = max(this->send, resp); if (resp != m2) { - /* after responding to this message the expected message ID is increased - * by one so we reduce it here */ - this->ike_sa->set_message_id(this->ike_sa, FALSE, m2 - 1); + this->ike_sa->set_message_id(this->ike_sa, FALSE, m2); } init = this->ike_sa->get_message_id(this->ike_sa, TRUE); p2 = max(this->recv, has_active_tasks(this) ? init + 1 : init); |