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

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