Blame SOURCES/macsec-0014-mka-Disable-peer-detection-timeout-for-PSK-mode.patch

41389a
From 008e224dbb518f44aac46b0c8e55448bd907e43d Mon Sep 17 00:00:00 2001
41389a
Message-Id: <008e224dbb518f44aac46b0c8e55448bd907e43d.1488376601.git.dcaratti@redhat.com>
41389a
From: Sabrina Dubroca <sd@queasysnail.net>
41389a
Date: Wed, 2 Nov 2016 16:38:36 +0100
41389a
Subject: [PATCH] mka: Disable peer detection timeout for PSK mode
41389a
41389a
The first peer may take a long time to come up. In PSK mode we are
41389a
basically in a p2p system, and we cannot know when a peer will join the
41389a
key exchange. Wait indefinitely, and let the administrator decide if
41389a
they want to abort.
41389a
41389a
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
41389a
---
41389a
 src/pae/ieee802_1x_kay.c | 12 ++++++++++--
41389a
 1 file changed, 10 insertions(+), 2 deletions(-)
41389a
41389a
diff --git a/src/pae/ieee802_1x_kay.c b/src/pae/ieee802_1x_kay.c
41389a
index 2841b10..19b2c2f 100644
41389a
--- a/src/pae/ieee802_1x_kay.c
41389a
+++ b/src/pae/ieee802_1x_kay.c
41389a
@@ -3339,8 +3339,16 @@ ieee802_1x_kay_create_mka(struct ieee802_1x_kay *kay, struct mka_key_name *ckn,
41389a
 	usecs = os_random() % (MKA_HELLO_TIME * 1000);
41389a
 	eloop_register_timeout(0, usecs, ieee802_1x_participant_timer,
41389a
 			       participant, NULL);
41389a
-	participant->mka_life = MKA_LIFE_TIME / 1000 + time(NULL) +
41389a
-		usecs / 1000000;
41389a
+
41389a
+	/* Disable MKA lifetime for PSK mode.
41389a
+	 * The peer(s) can take a long time to come up, because we
41389a
+	 * create a "standby" MKA, and we need it to remain live until
41389a
+	 * some peer appears.
41389a
+	 */
41389a
+	if (mode != PSK) {
41389a
+		participant->mka_life = MKA_LIFE_TIME / 1000 + time(NULL) +
41389a
+			usecs / 1000000;
41389a
+	}
41389a
 
41389a
 	return participant;
41389a
 
41389a
-- 
41389a
2.7.4
41389a