[RFC 15/30] WPA: Update 802.1X over authentication frames PTK derivation

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


Add APIs to the WPA SM to get the SMD Identifier and SMD_KDK
length and update the PMK to PTK derivation to also consider SMD
state.

Signed-off-by: Ilan Peer <ilan.peer at intel.com>
---
 src/rsn_supp/wpa.c   | 18 ++++++++++++++++++
 src/rsn_supp/wpa.h   | 12 ++++++++++++
 wpa_supplicant/sme.c |  5 ++++-
 3 files changed, 34 insertions(+), 1 deletion(-)

diff --git a/src/rsn_supp/wpa.c b/src/rsn_supp/wpa.c
index 980d659c3a4e..6e6f67e0593b 100644
--- a/src/rsn_supp/wpa.c
+++ b/src/rsn_supp/wpa.c
@@ -6118,6 +6118,24 @@ int wpa_sm_set_ap_smd_info(struct wpa_sm *sm, const u8 *ie)
 }
 
 
+const u8 * wpa_sm_get_smd_id(struct wpa_sm *sm)
+{
+	if (!sm || !sm->smd || !sm->ap_smd_info)
+		return NULL;
+
+	return sm->ap_smd_info;
+}
+
+
+size_t wpa_sm_get_smd_kdk_len(struct wpa_sm *sm, size_t pmk_len)
+{
+	if (!sm || !wpa_sm_is_smd_per_ap_mld_ptk(sm))
+		return 0;
+
+	return pmk_len;
+}
+
+
 /**
  * wpa_sm_parse_own_wpa_ie - Parse own WPA/RSN IE
  * @sm: Pointer to WPA state machine data from wpa_sm_init()
diff --git a/src/rsn_supp/wpa.h b/src/rsn_supp/wpa.h
index 7e51d76692db..d510f372f357 100644
--- a/src/rsn_supp/wpa.h
+++ b/src/rsn_supp/wpa.h
@@ -234,6 +234,8 @@ int wpa_sm_set_ap_rsnxe_override(struct wpa_sm *sm, const u8 *ie, size_t len);
 int wpa_sm_set_ap_security_profile(struct wpa_sm *sm, const u8 *elem,
 				   size_t len);
 int wpa_sm_set_ap_smd_info(struct wpa_sm *sm, const u8 *ie);
+const u8 * wpa_sm_get_smd_id(struct wpa_sm *sm);
+size_t wpa_sm_get_smd_kdk_len(struct wpa_sm *sm, size_t pmk_len);
 int wpa_sm_get_mib(struct wpa_sm *sm, char *buf, size_t buflen);
 
 int wpa_sm_set_param(struct wpa_sm *sm, enum wpa_sm_conf_params param,
@@ -430,6 +432,16 @@ static inline int wpa_sm_set_ap_security_profile(struct wpa_sm *sm,
 	return -1;
 }
 
+static inline const u8 * wpa_sm_get_smd_id(struct wpa_sm *sm)
+{
+	return NULL;
+}
+
+static inline size_t wpa_sm_get_smd_kdk_len(struct wpa_sm *sm, size_t pmk_len)
+{
+	return 0;
+}
+
 static inline int wpa_sm_get_mib(struct wpa_sm *sm, char *buf, size_t buflen)
 {
 	return 0;
diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c
index 802ca8bc6ca2..d928367c6d2f 100644
--- a/wpa_supplicant/sme.c
+++ b/wpa_supplicant/sme.c
@@ -4627,7 +4627,10 @@ static int sme_802_1x_derive_ptk_and_install(struct wpa_supplicant *wpa_s,
 				       key_mgmt, pairwise_cipher,
 				       wpabuf_head(auth_1x->dhss),
 				       wpabuf_len(auth_1x->dhss),
-				       &ptk, kdk_len, 0, NULL) < 0) {
+				       &ptk, kdk_len,
+				       wpa_sm_get_smd_kdk_len(wpa_s->wpa,
+							      pmk_len),
+				       wpa_sm_get_smd_id(wpa_s->wpa)) < 0) {
 		wpa_msg(wpa_s, MSG_INFO, "SME: PTK derivation failed");
 		forced_memzero(pmk, PMK_LEN_MAX);
 		return -1;
-- 
2.55.0




More information about the Hostap mailing list