[PATCH 09/55] AP: Add the MDE and FTE to IEEE 802.1X Authentication frames

Ilan Peer ilan.peer at intel.com
Thu Dec 3 02:44:08 PST 2026


With FT initial mobility domain association, include the MDE and
an FTE (R0KH-ID, R1KH-ID, no MIC) in the second Authentication frame.

Signed-off-by: Ilan Peer <ilan.peer at intel.com>
---
 src/ap/ieee802_11.c | 41 +++++++++++++++++++++++++++++++++++++++++
 src/ap/wpa_auth.c   | 17 +++++++++++++++++
 src/ap/wpa_auth.h   |  4 ++++
 3 files changed, 62 insertions(+)

diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
index e20a189ca95e..76e5aee1652b 100644
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
@@ -3029,6 +3029,39 @@ static u16 prepare_802_1x_dh_param(struct hostapd_data *hapd,
 	return WLAN_STATUS_SUCCESS;
 }
 
+#ifdef CONFIG_IEEE80211R_AP
+
+static int prepare_802_1x_ft_elems(struct hostapd_data *hapd,
+				   struct sta_info *sta, struct wpabuf *data)
+{
+	int res;
+
+	if (!sta->wpa_sm)
+		sta->wpa_sm = wpa_auth_sta_init(hapd->wpa_auth, sta->addr,
+						NULL);
+
+	if (!sta->wpa_sm)
+		return -1;
+
+	res = wpa_auth_write_mde(hapd->wpa_auth, wpabuf_put(data, 0),
+				 wpabuf_tailroom(data));
+	if (res < 0)
+		return -1;
+
+	wpabuf_put(data, res);
+
+	res = wpa_auth_write_fte_no_mic(hapd->wpa_auth,
+					sta->eap_auth_data.akm,
+					wpabuf_put(data, 0),
+					wpabuf_tailroom(data));
+	if (res < 0)
+		return -1;
+
+	wpabuf_put(data, res);
+	return 0;
+}
+
+#endif /* CONFIG_IEEE80211R_AP */
 
 static struct wpabuf *
 prepare_802_1x_auth_resp(struct hostapd_data *hapd, struct sta_info *sta,
@@ -3134,6 +3167,14 @@ prepare_802_1x_auth_resp(struct hostapd_data *hapd, struct sta_info *sta,
 			wpabuf_put_u8(data, 1 + WPA_NONCE_LEN);
 			wpabuf_put_u8(data, WLAN_EID_EXT_NONCE);
 			wpabuf_put_data(data, a_nonce, WPA_NONCE_LEN);
+
+#ifdef CONFIG_IEEE80211R_AP
+			if (sta->eap_auth_data.ft &&
+			    prepare_802_1x_ft_elems(hapd, sta, data) < 0) {
+				status = WLAN_STATUS_UNSPECIFIED_FAILURE;
+				goto reply;
+			}
+#endif /* CONFIG_IEEE80211R_AP */
 		} else {
 			/* Per IEEE Std 802.11bi-2026, 12.16.5 (IEEE 802.1X
 			 * authentication utilizing Authentication frames), the
diff --git a/src/ap/wpa_auth.c b/src/ap/wpa_auth.c
index 88e9e9590b93..5fc052096ed2 100644
--- a/src/ap/wpa_auth.c
+++ b/src/ap/wpa_auth.c
@@ -7662,6 +7662,23 @@ int wpa_auth_write_fte(struct wpa_authenticator *wpa_auth,
 			      conf->r0_key_holder, conf->r0_key_holder_len,
 			      NULL, NULL, buf, len, NULL, 0, 0, false);
 }
+
+
+int wpa_auth_write_mde(struct wpa_authenticator *wpa_auth, u8 *buf, size_t len)
+{
+	return wpa_write_mdie(&wpa_auth->conf, buf, len);
+}
+
+
+int wpa_auth_write_fte_no_mic(struct wpa_authenticator *wpa_auth, int akmp,
+			      u8 *buf, size_t len)
+{
+	struct wpa_auth_config *conf = &wpa_auth->conf;
+
+	return wpa_write_ftie(conf, akmp, 0, conf->r0_key_holder,
+			      conf->r0_key_holder_len, NULL, NULL, buf, len,
+			      NULL, 0, 0, true);
+}
 #endif /* CONFIG_IEEE80211R_AP */
 
 
diff --git a/src/ap/wpa_auth.h b/src/ap/wpa_auth.h
index aa0cd953029a..41f467f903a1 100644
--- a/src/ap/wpa_auth.h
+++ b/src/ap/wpa_auth.h
@@ -664,6 +664,10 @@ int get_sta_tx_parameters(struct wpa_state_machine *sm, int ap_max_chanwidth,
 int wpa_auth_write_fte(struct wpa_authenticator *wpa_auth,
 		       struct wpa_state_machine *sm,
 		       u8 *buf, size_t len);
+int wpa_auth_write_mde(struct wpa_authenticator *wpa_auth, u8 *buf,
+		       size_t len);
+int wpa_auth_write_fte_no_mic(struct wpa_authenticator *wpa_auth, int akmp,
+			      u8 *buf, size_t len);
 void wpa_auth_get_fils_aead_params(struct wpa_state_machine *sm,
 				   u8 *fils_anonce, u8 *fils_snonce,
 				   u8 *fils_kek, size_t *fils_kek_len);
-- 
2.55.0




More information about the Hostap mailing list