Blame SOURCES/macsec-0034-mka-Some-bug-fixes-for-MACsec-in-PSK-mode.patch

b645d2
From e54691106b29f41aa3081b00eb4f48e411cebc72 Mon Sep 17 00:00:00 2001
b645d2
Message-Id: <e54691106b29f41aa3081b00eb4f48e411cebc72.1488376602.git.dcaratti@redhat.com>
b645d2
From: Badrish Adiga H R <badrish.adigahr@gmail.com>
b645d2
Date: Fri, 6 Jan 2017 15:27:10 +0530
b645d2
Subject: [PATCH] mka: Some bug fixes for MACsec in PSK mode
b645d2
b645d2
Issue:
b645d2
------
b645d2
The test setup has 2 peers running MACsec in PSK mode, Peer A with
b645d2
MAC address higher than MAC Address of peer B. Test sequence is
b645d2
1. Peer B starts with actor_priority 255
b645d2
2. Peer A starts with priority 16, becomes key server.
b645d2
3. Peer A stops..
b645d2
4. Peer A restarts with priority 255, but because of the stale values
b645d2
participant->is_key_server(=TRUE) and participant->is_elected(=TRUE)
b645d2
it continues to remain as Key Server.
b645d2
5. For peer B, key server election happens and since it has lower MAC
b645d2
address as compared to MAC address of A, it becomes the key server.
b645d2
Now we have 2 key servers in CA and is not correct.
b645d2
b645d2
Root-cause & fix:
b645d2
-----------------
b645d2
When number of live peers become 0, the flags such lrx, ltx, orx,
b645d2
otx, etc. need to be cleared. In MACsec PSK mode, these stale values
b645d2
create problems while re-establishing CA.
b645d2
b645d2
Signed-off-by: Badrish Adiga H R <badrish.adigahr@gmail.com>
b645d2
---
b645d2
 src/pae/ieee802_1x_kay.c | 6 ++++++
b645d2
 1 file changed, 6 insertions(+)
b645d2
b645d2
diff --git a/src/pae/ieee802_1x_kay.c b/src/pae/ieee802_1x_kay.c
b645d2
index 79a6878..92fd7ba 100644
b645d2
--- a/src/pae/ieee802_1x_kay.c
b645d2
+++ b/src/pae/ieee802_1x_kay.c
b645d2
@@ -2378,6 +2378,12 @@ static void ieee802_1x_participant_timer(void *eloop_ctx, void *timeout_ctx)
b645d2
 			participant->advised_capability =
b645d2
 				MACSEC_CAP_NOT_IMPLEMENTED;
b645d2
 			participant->to_use_sak = FALSE;
b645d2
+			participant->ltx = FALSE;
b645d2
+			participant->lrx = FALSE;
b645d2
+			participant->otx = FALSE;
b645d2
+			participant->orx = FALSE;
b645d2
+			participant->is_key_server = FALSE;
b645d2
+			participant->is_elected = FALSE;
b645d2
 			kay->authenticated = TRUE;
b645d2
 			kay->secured = FALSE;
b645d2
 			kay->failed = FALSE;
b645d2
-- 
b645d2
2.7.4
b645d2