ikev1: Fix handling of overlapping Quick Mode exchanges

In some cases the third message of a Quick Mode exchange might arrive
after the first message of a subsequent Quick Mode exchange.  Previously
these messages were handled incorrectly and the second Quick Mode
exchange failed.

Some implementations might even try to establish multiple Quick Modes
simultaneously, which is explicitly allowed in RFC 2409.  We don't fully
support that, though, in particular in case of retransmits.

Fixes #1076.
This commit is contained in:
Tobias Brunner
2015-08-20 19:13:45 +02:00
parent e2a252a86f
commit 4de361d92c
3 changed files with 70 additions and 2 deletions
+11
View File
@@ -1,4 +1,7 @@
/*
* Copyright (C) 2015 Tobias Brunner
* Hochschule fuer Technik Rapperswil
*
* Copyright (C) 2011 Martin Willi
* Copyright (C) 2011 revosec AG
*
@@ -37,6 +40,14 @@ struct quick_mode_t {
*/
task_t task;
/**
* Get the message ID of the quick mode exchange handled by this task as
* responder.
*
* @return message ID, or 0 (not defined yet or as initiator)
*/
u_int32_t (*get_mid)(quick_mode_t *this);
/**
* Use a specific reqid to install this CHILD_SA.
*