iwd.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/9] eapol: set secure on message 2/4 properly
@ 2023-01-11 20:15 James Prestwood
  2023-01-11 20:15 ` [PATCH 2/9] unit: update test-eapol with API change James Prestwood
                   ` (8 more replies)
  0 siblings, 9 replies; 11+ messages in thread
From: James Prestwood @ 2023-01-11 20:15 UTC (permalink / raw)
  To: iwd; +Cc: James Prestwood

The second handshake message was hard coded with the secure bit as
zero but for rekeys the secure bit should be set to 1. Fix this by
changing the 2/4 builder to take a boolean which will set the bit
properly.

It should be noted that hostapd doesn't check this bit so EAPoL
worked just fine, but IWD's checks are more strict.
---
 src/eapol.c | 12 +++++++-----
 src/eapol.h |  3 ++-
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/eapol.c b/src/eapol.c
index c7480c11..593daf41 100644
--- a/src/eapol.c
+++ b/src/eapol.c
@@ -766,11 +766,12 @@ struct eapol_key *eapol_create_ptk_2_of_4(
 				size_t extra_len,
 				const uint8_t *extra_data,
 				bool is_wpa,
-				size_t mic_len)
+				size_t mic_len,
+				bool secure)
 {
-	return eapol_create_common(protocol, version, false, key_replay_counter,
-					snonce, extra_len, extra_data, 1,
-					is_wpa, mic_len);
+	return eapol_create_common(protocol, version, secure,
+					key_replay_counter, snonce, extra_len,
+					extra_data, 1, is_wpa, mic_len);
 }
 
 struct eapol_key *eapol_create_ptk_4_of_4(
@@ -1326,7 +1327,8 @@ static void eapol_handle_ptk_1_of_4(struct eapol_sm *sm,
 					ek->key_descriptor_version,
 					L_BE64_TO_CPU(ek->key_replay_counter),
 					sm->handshake->snonce, ies_len, ies,
-					sm->handshake->wpa_ie, sm->mic_len);
+					sm->handshake->wpa_ie, sm->mic_len,
+					sm->rekey);
 
 	kck = handshake_state_get_kck(sm->handshake);
 
diff --git a/src/eapol.h b/src/eapol.h
index 8d8d5252..43dc224d 100644
--- a/src/eapol.h
+++ b/src/eapol.h
@@ -83,7 +83,8 @@ struct eapol_key *eapol_create_ptk_2_of_4(
 				size_t extra_len,
 				const uint8_t *extra_data,
 				bool is_wpa,
-				size_t mic_len);
+				size_t mic_len,
+				bool secure);
 
 struct eapol_key *eapol_create_ptk_4_of_4(
 				enum eapol_protocol_version protocol,
-- 
2.34.3


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-01-11 22:32 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-11 20:15 [PATCH 1/9] eapol: set secure on message 2/4 properly James Prestwood
2023-01-11 20:15 ` [PATCH 2/9] unit: update test-eapol with API change James Prestwood
2023-01-11 20:15 ` [PATCH 3/9] eapol: implement rekey support for authenticator James Prestwood
2023-01-11 20:15 ` [PATCH 4/9] handshake: add event for rekey success James Prestwood
2023-01-11 22:30   ` Denis Kenzior
2023-01-11 20:15 ` [PATCH 5/9] netdev: unset ptk_installed flag for TK James Prestwood
2023-01-11 20:15 ` [PATCH 6/9] netdev: support HANDSHAKE_EVENT_REKEY_COMPLETE James Prestwood
2023-01-11 20:15 ` [PATCH 7/9] eapol: relax secure bit check on 2/4 James Prestwood
2023-01-11 20:15 ` [PATCH 8/9] ap: support PTK rekeys James Prestwood
2023-01-11 20:15 ` [PATCH 9/9] doc: Document RekeyTimeout for AP profiles James Prestwood
2023-01-11 22:05 ` [PATCH 1/9] eapol: set secure on message 2/4 properly Denis Kenzior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).