[PATCH] wpa_supplicant: Add CONFIG_NO_WPA stubs for Security Profile support

Chaitanya Tata chaitanya.mgit at gmail.com
Thu Sep 10 12:55:51 PDT 2026


The Security Profile feature (IEEE P802.11bn/D2.0) added
wpa_sm_set_security_profile(), sec_prof_get(),
security_profile_akm_matches(), security_profile_build_sta() and
security_profile_build_empty(), all of which are called
unconditionally from wpa_supplicant.c/sme.c, but are only implemented
in src/rsn_supp/wpa.c, src/rsn_supp/wpa_ie.c and src/common/
wpa_common.c. Those source files are not built when CONFIG_NO_WPA is
set, so wpa_supplicant fails to link with undefined references to
all five functions.

Add CONFIG_NO_WPA stubs for them, following the existing pattern used
for the rest of the WPA/RSN API in these headers. Verified that
wpa_supplicant now builds and links with CONFIG_NO_WPA=y (it
previously failed with the errors above).

Signed-off-by: Chaitanya Tata <Chaitanya.Tata at nordicsemi.no>
---
 src/common/wpa_common.h |  8 ++++++++
 src/rsn_supp/wpa.h      |  6 ++++++
 src/rsn_supp/wpa_ie.h   | 27 ++++++++++++++++++++++++---
 3 files changed, 38 insertions(+), 3 deletions(-)

diff --git a/src/common/wpa_common.h b/src/common/wpa_common.h
index fe8b32f8b..a140b45be 100644
--- a/src/common/wpa_common.h
+++ b/src/common/wpa_common.h
@@ -874,6 +874,14 @@ struct security_profile_entry {
 
 
 int sec_prof_implied_key_mgmt(const int *profiles);
+
+#ifndef CONFIG_NO_WPA
 const struct security_profile_entry * sec_prof_get(int p);
+#else /* CONFIG_NO_WPA */
+static inline const struct security_profile_entry * sec_prof_get(int p)
+{
+	return NULL;
+}
+#endif /* CONFIG_NO_WPA */
 
 #endif /* WPA_COMMON_H */
diff --git a/src/rsn_supp/wpa.h b/src/rsn_supp/wpa.h
index 68be29fcd..9e35bdd08 100644
--- a/src/rsn_supp/wpa.h
+++ b/src/rsn_supp/wpa.h
@@ -431,6 +431,12 @@ static inline int wpa_sm_set_ap_rsnxe_override(struct wpa_sm *sm, const u8 *ie,
 	return -1;
 }
 
+static inline int wpa_sm_set_security_profile(struct wpa_sm *sm,
+					       const struct security_profile_entry *sp)
+{
+	return -1;
+}
+
 static inline int wpa_sm_set_ap_security_profile(struct wpa_sm *sm,
 						 const u8 *elem,
 						 size_t len)
diff --git a/src/rsn_supp/wpa_ie.h b/src/rsn_supp/wpa_ie.h
index b87135746..4589d4674 100644
--- a/src/rsn_supp/wpa_ie.h
+++ b/src/rsn_supp/wpa_ie.h
@@ -23,17 +23,38 @@ int wpa_external_auth_add_rsne(struct wpa_sm *sm, u8 *rsne, size_t rsne_len,
 			       int group_mgmt_cipher, u16 rsn_capab,
 			       const u8 *pmkid);
 u64 wpa_sm_get_rsnxe_capab(struct wpa_sm *sm);
-bool security_profile_akm_matches(int profile_num, int key_mgmt);
 bool security_profile_has_eppke(const u8 *sp, int ssid_key_mgmt);
 const struct security_profile_entry *
 security_profile_select(int akmp, int pairwise_cipher,
 			bool eap_over_auth, bool eppke,
 			const u8 *bitmap, size_t bitmap_len);
-int security_profile_build_sta(struct wpa_sm *sm, int selected_profile_num,
-			       u8 *buf, size_t buf_len);
 int security_profile_build(u16 rsn_capab, const u8 *rsnxe,
 			   size_t rsnxe_len, int selected_profile_num,
 			   u8 *buf, size_t buf_len);
+
+#ifndef CONFIG_NO_WPA
+bool security_profile_akm_matches(int profile_num, int key_mgmt);
+int security_profile_build_sta(struct wpa_sm *sm, int selected_profile_num,
+			       u8 *buf, size_t buf_len);
 int security_profile_build_empty(u8 *buf, size_t buf_len);
+#else /* CONFIG_NO_WPA */
+static inline bool security_profile_akm_matches(int profile_num,
+						 int key_mgmt)
+{
+	return false;
+}
+
+static inline int security_profile_build_sta(struct wpa_sm *sm,
+					      int selected_profile_num,
+					      u8 *buf, size_t buf_len)
+{
+	return -1;
+}
+
+static inline int security_profile_build_empty(u8 *buf, size_t buf_len)
+{
+	return -1;
+}
+#endif /* CONFIG_NO_WPA */
 
 #endif /* WPA_IE_H */
-- 
2.43.0




More information about the Hostap mailing list