[PATCH 3/7] EAP-AUTH: Allow AP without RSNXE in 802.1X Authentication MIC

Andrei Otcheretianski andrei.otcheretianski at intel.com
Tue Nov 24 06:30:24 PST 2026


From: Ilan Peer <ilan.peer at intel.com>

The MIC calculation as defined in Draft IEEE802.11bi/D6.0 in Section
12.16.8.3 states that RSNXE should be included in the MIC calculation
iff it was included in the AP's beacons etc. Thus, fix the station
side implementation to align with this (the AP side implementation
already aligns with this).

Note that while this aligns with the specification definitions,
currently this case is not a valid case for APs that support
802.1X authentication over authentication frames as RSNXE element
must be included (as bits 27 and 28 must be included).

Signed-off-by: Ilan Peer <ilan.peer at intel.com>
---
 wpa_supplicant/sme.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c
index 666a994b02..d50a4ecbc6 100644
--- a/wpa_supplicant/sme.c
+++ b/wpa_supplicant/sme.c
@@ -4079,11 +4079,13 @@ static int sme_validate_802_1x_auth_mic(struct wpa_supplicant *wpa_s,
 
 	ap_rsne = wpa_bss_get_rsne(wpa_s, bss, wpa_s->current_ssid, false);
 	ap_rsnxe = wpa_bss_get_rsnxe(wpa_s, bss, wpa_s->current_ssid, false);
-	if (!ap_rsne || !ap_rsnxe)
+	if (!ap_rsne)
 		return -1;
 
 	ap_rsne_len = 2 + ap_rsne[1];
-	ap_rsnxe_len = 2 + ap_rsnxe[1];
+
+	/* The AP RSNXE is omitted from the MIC when it is not advertised */
+	ap_rsnxe_len = ap_rsnxe ? 2 + ap_rsnxe[1] : 0;
 
 	mic_elem = get_ie(frame_data, frame_data_len, WLAN_EID_MIC);
 	if (!mic_elem) {
@@ -4123,8 +4125,12 @@ static int sme_validate_802_1x_auth_mic(struct wpa_supplicant *wpa_s,
 	pos += ETH_ALEN;
 	os_memcpy(pos, ap_rsne, ap_rsne_len);
 	pos += ap_rsne_len;
-	os_memcpy(pos, ap_rsnxe, ap_rsnxe_len);
-	pos += ap_rsnxe_len;
+
+	if (ap_rsnxe) {
+		os_memcpy(pos, ap_rsnxe, ap_rsnxe_len);
+		pos += ap_rsnxe_len;
+	}
+
 	os_memcpy(pos, frame_data, frame_data_len);
 
 	/* Clear the MIC field */
-- 
2.56.1




More information about the Hostap mailing list