[PATCH 16/29] EPPKE: EPP peer indication to driver

Sai Pratyusha Magam smagam at qti.qualcomm.com
Thu Dec 11 05:14:30 PST 2025


Indicate that a peer is an Enhanced Privacy
Protection (EPP) peer via the netlink attribute
@NL80211_ATTR_EPP_PEER in @NL80211_CMD_NEW_STA
and @NL80211_CMD_ADD_LINK_STA

Signed-off-by: Sai Pratyusha Magam <smagam at qti.qualcomm.com>
Signed-off-by: Rohan Dutta <drohan at qti.qualcomm.com>
---
 src/ap/ap_drv_ops.c          |  6 ++++--
 src/ap/ap_drv_ops.h          |  2 +-
 src/ap/ieee802_11.c          | 15 ++++++++++++---
 src/ap/sta_info.c            |  8 ++++++--
 src/drivers/driver.h         |  3 +++
 src/drivers/driver_nl80211.c |  8 ++++++++
 6 files changed, 34 insertions(+), 8 deletions(-)

diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
index 10719bde6..bb353ac35 100644
--- a/src/ap/ap_drv_ops.c
+++ b/src/ap/ap_drv_ops.c
@@ -480,7 +480,7 @@ int hostapd_sta_add(struct hostapd_data *hapd,
 		    const struct ieee80211_he_6ghz_band_cap *he_6ghz_capab,
 		    u32 flags, u8 qosinfo, u8 vht_opmode, int supp_p2p_ps,
 		    int set, const u8 *link_addr, bool mld_link_sta,
-		    u16 eml_cap)
+		    u16 eml_cap, bool epp_sta)
 {
 	struct hostapd_sta_add_params params;
 
@@ -510,7 +510,9 @@ int hostapd_sta_add(struct hostapd_data *hapd,
 	params.support_p2p_ps = supp_p2p_ps;
 	params.set = set;
 	params.mld_link_id = -1;
-
+#ifdef CONFIG_ENC_ASSOC
+	params.epp_sta = epp_sta;
+#endif
 #ifdef CONFIG_IEEE80211BE
 	/*
 	 * An AP MLD needs to always specify to what link the station needs
diff --git a/src/ap/ap_drv_ops.h b/src/ap/ap_drv_ops.h
index 517c16e35..671b99042 100644
--- a/src/ap/ap_drv_ops.h
+++ b/src/ap/ap_drv_ops.h
@@ -50,7 +50,7 @@ int hostapd_sta_add(struct hostapd_data *hapd,
 		    const struct ieee80211_he_6ghz_band_cap *he_6ghz_capab,
 		    u32 flags, u8 qosinfo, u8 vht_opmode, int supp_p2p_ps,
 		    int set, const u8 *link_addr, bool mld_link_sta,
-		    u16 eml_cap);
+		    u16 eml_cap, bool epp_sta);
 int hostapd_set_privacy(struct hostapd_data *hapd, int enabled);
 int hostapd_set_generic_elem(struct hostapd_data *hapd, const u8 *elem,
 			     size_t elem_len);
diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
index adbe87f3c..8140f09fb 100644
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
@@ -4475,7 +4475,11 @@ static int __check_assoc_ies(struct hostapd_data *hapd, struct sta_info *sta,
 	const u8 *wpa_ie;
 	size_t wpa_ie_len;
 	const u8 *p2p_dev_addr = NULL;
+	bool epp_sta = false;
 
+#ifdef CONFIG_ENC_ASSOC
+	epp_sta = sta->epp_sta;
+#endif
 	if (type != LINK_PARSE_RECONF) {
 		resp = check_ssid(hapd, sta, elems->ssid, elems->ssid_len);
 		if (resp != WLAN_STATUS_SUCCESS)
@@ -4764,7 +4768,7 @@ static int __check_assoc_ies(struct hostapd_data *hapd, struct sta_info *sta,
 			wpa_printf(MSG_DEBUG, "SAE: " MACSTR
 				   " using PMKSA caching", MAC2STR(sta->addr));
 			sae_assign_vlan(hapd, sta, sa->sae_vlan_id);
-		} else if (wpa_auth_uses_sae(sta->wpa_sm) &&
+		} else if (!epp_sta && wpa_auth_uses_sae(sta->wpa_sm) &&
 			   sta->auth_alg != WLAN_AUTH_SAE &&
 			   !(sta->auth_alg == WLAN_AUTH_FT &&
 			     wpa_auth_uses_ft_sae(sta->wpa_sm))) {
@@ -5346,9 +5350,13 @@ static int add_associated_sta(struct hostapd_data *hapd,
 	struct ieee80211_eht_capabilities eht_cap;
 	int set = 1;
 	const u8 *mld_link_addr = NULL;
-	bool mld_link_sta = false;
+	bool mld_link_sta = false, epp_sta = false;
 	u16 eml_cap = 0;
 
+#ifdef CONFIG_ENC_ASSOC
+	epp_sta = sta->epp_sta;
+#endif
+
 #ifdef CONFIG_IEEE80211BE
 	if (ap_sta_is_mld(hapd, sta)) {
 		u8 mld_link_id = hapd->mld_link_id;
@@ -5439,7 +5447,8 @@ static int add_associated_sta(struct hostapd_data *hapd,
 			    sta->he_6ghz_capab,
 			    sta->flags | WLAN_STA_ASSOC, sta->qosinfo,
 			    sta->vht_opmode, sta->p2p_ie ? 1 : 0,
-			    set, mld_link_addr, mld_link_sta, eml_cap)) {
+			    set, mld_link_addr, mld_link_sta, eml_cap,
+			    epp_sta)) {
 		hostapd_logger(hapd, sta->addr,
 			       HOSTAPD_MODULE_IEEE80211, HOSTAPD_LEVEL_NOTICE,
 			       "Could not %s STA to kernel driver",
diff --git a/src/ap/sta_info.c b/src/ap/sta_info.c
index b23a856b6..657f04911 100644
--- a/src/ap/sta_info.c
+++ b/src/ap/sta_info.c
@@ -1986,9 +1986,12 @@ static void ap_sta_remove_link_sta(struct hostapd_data *hapd,
 int ap_sta_re_add(struct hostapd_data *hapd, struct sta_info *sta)
 {
 	const u8 *mld_link_addr = NULL;
-	bool mld_link_sta = false;
+	bool mld_link_sta = false, epp_sta = false;
 	u16 eml_cap = 0;
 
+#ifdef CONFIG_ENC_ASSOC
+	epp_sta = sta->epp_sta;
+#endif
 	/*
 	 * If a station that is already associated to the AP, is trying to
 	 * authenticate again, remove the STA entry, in order to make sure the
@@ -2022,7 +2025,8 @@ int ap_sta_re_add(struct hostapd_data *hapd, struct sta_info *sta)
 			    sta->supported_rates_len,
 			    0, NULL, NULL, NULL, 0, NULL, 0, NULL,
 			    sta->flags, 0, 0, 0, 0,
-			    mld_link_addr, mld_link_sta, eml_cap)) {
+			    mld_link_addr, mld_link_sta, eml_cap,
+			    epp_sta)) {
 		hostapd_logger(hapd, sta->addr,
 			       HOSTAPD_MODULE_IEEE80211,
 			       HOSTAPD_LEVEL_NOTICE,
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index 2ed0282eb..e727dabf9 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -2668,6 +2668,9 @@ struct hostapd_sta_add_params {
 	size_t eht_capab_len;
 	u32 flags; /* bitmask of WPA_STA_* flags */
 	u32 flags_mask; /* unset bits in flags */
+#ifdef CONFIG_ENC_ASSOC
+	bool epp_sta;
+#endif
 #ifdef CONFIG_MESH
 	enum mesh_plink_state plink_state;
 	u16 peer_aid;
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 09df1d0e4..4a38a5111 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -6208,6 +6208,14 @@ static int wpa_driver_nl80211_sta_add(void *priv,
 			goto fail;
 	}
 
+#ifdef CONFIG_ENC_ASSOC
+	if (params->epp_sta) {
+		wpa_printf(MSG_DEBUG, "EPP STA");
+		if (nla_put_flag(msg, NL80211_ATTR_EPP_PEER))
+			goto fail;
+	}
+#endif
+
 	ret = send_and_recv_cmd(drv, msg);
 	msg = NULL;
 	if (ret)
-- 
2.34.1




More information about the Hostap mailing list