[RFC 23/30] EPPKE: Support SMD in Encrypted association processing

Ilan Peer ilan.peer at intel.com
Wed Oct 21 06:43:41 PDT 2026


When processing encrypted (Re)Association frame, install the SMD
KDK to the WPA SM so it could be used in subsequent flows (similar
to how the KEK is installed).

Signed-off-by: Ilan Peer <ilan.peer at intel.com>
---
 src/rsn_supp/wpa.c      | 11 +++++++++++
 src/rsn_supp/wpa.h      |  2 ++
 wpa_supplicant/events.c |  2 ++
 3 files changed, 15 insertions(+)

diff --git a/src/rsn_supp/wpa.c b/src/rsn_supp/wpa.c
index 66f16ee82c54..2ab2eca7c9d6 100644
--- a/src/rsn_supp/wpa.c
+++ b/src/rsn_supp/wpa.c
@@ -6455,6 +6455,17 @@ void wpa_sm_set_ptk_kck_kek(struct wpa_sm *sm, enum rsn_hash_alg hash,
 }
 
 
+void wpa_sm_set_ptk_smd_kdk(struct wpa_sm *sm, const u8 *smd_kdk,
+			    size_t smd_kdk_len)
+{
+	if (smd_kdk && smd_kdk_len && smd_kdk_len <= WPA_SMD_KDK_MAX_LEN) {
+		os_memcpy(sm->ptk.smd_kdk, smd_kdk, smd_kdk_len);
+		sm->ptk.smd_kdk_len = smd_kdk_len;
+		wpa_printf(MSG_DEBUG, "Updated PTK SMD KDK");
+	}
+}
+
+
 #ifdef CONFIG_TESTING_OPTIONS
 
 void wpa_sm_set_ptk_tk(struct wpa_sm *sm, const u8 *ptk_tk, size_t ptk_tk_len)
diff --git a/src/rsn_supp/wpa.h b/src/rsn_supp/wpa.h
index 6bbde7ad26cc..f7e187e425be 100644
--- a/src/rsn_supp/wpa.h
+++ b/src/rsn_supp/wpa.h
@@ -295,6 +295,8 @@ void wpa_sm_set_rx_replay_ctr(struct wpa_sm *sm, const u8 *rx_replay_counter);
 void wpa_sm_set_ptk_kck_kek(struct wpa_sm *sm, enum rsn_hash_alg hash,
 			    const u8 *ptk_kck, size_t ptk_kck_len,
 			    const u8 *ptk_kek, size_t ptk_kek_len);
+void wpa_sm_set_ptk_smd_kdk(struct wpa_sm *sm, const u8 *smd_kdk,
+			    size_t smd_kdk_len);
 void wpa_sm_set_ptk_tk(struct wpa_sm *sm, const u8 *ptk_tk, size_t ptk_tk_len);
 int wpa_sm_get_cached_tk(struct wpa_sm *sm, u8 *tk, size_t *tk_len);
 int wpa_fils_is_completed(struct wpa_sm *sm);
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index 5b289f00525a..dff5059d3686 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -3926,6 +3926,8 @@ static int wpas_rx_enc_assoc_resp(struct wpa_supplicant *wpa_s, const u8 *aa,
 	wpa_sm_set_ptk_kck_kek(wpa_s->wpa, entry->ptk.hash_alg,
 			       entry->ptk.kck, entry->ptk.kck_len,
 			       entry->ptk.kek, entry->ptk.kek_len);
+	wpa_sm_set_ptk_smd_kdk(wpa_s->wpa, entry->ptk.smd_kdk,
+			       entry->ptk.smd_kdk_len);
 
 #ifdef CONFIG_TESTING_OPTIONS
 	wpa_sm_set_ptk_tk(wpa_s->wpa, entry->ptk.tk, entry->ptk.tk_len);
-- 
2.55.0




More information about the Hostap mailing list