[PATCH 18/55] AP: Mark an FT station using association frame encryption as EPP peer

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


When the FT protocol negotiates association frame encryption, mark the
station as an EPP peer so that the following reassociation is
encrypted. The PTK is already set by the FT protocol, so do not set it
again on association.

Signed-off-by: Ilan Peer <ilan.peer at intel.com>
---
 src/ap/hostapd.c    |  4 +++-
 src/ap/ieee802_11.c | 12 ++++++++++++
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
index 762dc91fd079..9e2b012bd60d 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
@@ -4247,7 +4247,9 @@ void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta,
 	ieee802_1x_new_station(hapd, sta);
 
 #ifdef CONFIG_ENC_ASSOC
-		if (ap_sta_is_epp(sta) && sta->wpa_sm) {
+		/* With FT, the PTK was already set by the FT protocol */
+		if (ap_sta_is_epp(sta) && sta->wpa_sm &&
+		    sta->auth_alg != WLAN_AUTH_FT) {
 			const struct wpa_ptk *ptk;
 			const u8 *pmk;
 			size_t pmk_len;
diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
index 94dcfd8994ee..1fa4b0b6df67 100644
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
@@ -6049,6 +6049,18 @@ static void handle_auth(struct hostapd_data *hapd,
 	}
 #endif /* CONFIG_ENC_ASSOC || CONFIG_IEEE8021X_AUTH */
 
+#if defined(CONFIG_IEEE80211R_AP) && defined(CONFIG_ENC_ASSOC)
+	if (auth_alg == WLAN_AUTH_FT) {
+		sta->epp_sta = wpa_ft_auth_uses_enc_assoc(
+			hapd->wpa_auth, mgmt->u.auth.variable,
+			len - IEEE80211_HDRLEN - sizeof(mgmt->u.auth));
+
+		if (sta->epp_sta)
+			wpa_printf(MSG_DEBUG,
+				   "FT: Mark the station as an EPP peer");
+	}
+#endif /* CONFIG_IEEE80211R_AP && CONFIG_ENC_ASSOC */
+
 #ifdef CONFIG_IEEE80211BE
 	/* Set the non-AP MLD information based on the initial Authentication
 	 * frame. Once the STA entry has been added to the driver, the driver
-- 
2.55.0




More information about the Hostap mailing list