[PATCH 08/15] tests: Security Profile element missing from Association Request

Andrei Otcheretianski andrei.otcheretianski at intel.com
Tue Nov 24 00:53:04 PST 2026


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

Verify that the AP rejects a (Re)Association Request frame without the
Security Profile element when the station included it in the EPPKE
Authentication frame.

Signed-off-by: Ilan Peer <ilan.peer at intel.com>
---
 tests/hwsim/test_security_profiles.py | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/tests/hwsim/test_security_profiles.py b/tests/hwsim/test_security_profiles.py
index ff3aa1044d..7db1921230 100644
--- a/tests/hwsim/test_security_profiles.py
+++ b/tests/hwsim/test_security_profiles.py
@@ -551,6 +551,30 @@ def test_security_profile_9_m3_missing(dev, apdev):
     """Security Profile 9 - Security Profile element missing from msg 3/4"""
     run_security_profile_9_m3(dev, apdev, "", "absent in EAPOL-Key msg 3/4")
 
+def test_security_profile_0_assoc_missing(dev, apdev):
+    """Security Profile 0 - Security Profile element missing from Association Request"""
+    check_eppke_capab(dev[0])
+    hapd = start_eppke_ap_security_profile_0(apdev[0])
+
+    try:
+        enable_sta_security_profiles(dev[0], 0)
+        dev[0].set("sec_prof_override_assoc", "")
+        dev[0].connect("sp0-eppke", scan_freq="2412", key_mgmt="EPPKE",
+                       ieee80211w="2", beacon_prot="1",
+                       pairwise="GCMP-256", group="GCMP-256",
+                       group_mgmt="BIP-GMAC-256", pmksa_privacy="1",
+                       wait_connect=False)
+        ev = dev[0].wait_event(["CTRL-EVENT-ASSOC-REJECT",
+                                "CTRL-EVENT-CONNECTED"], timeout=10)
+        dev[0].request("REMOVE_NETWORK all")
+        if ev is None:
+            raise Exception("Association was not rejected")
+        if "status_code=159" not in ev:
+            raise Exception("Unexpected association result: " + ev)
+    finally:
+        dev[0].set("sec_prof_override_assoc", "NULL")
+        sta_cleanup(dev[0])
+
 def run_sp9_sp_mlo_m3(dev, apdev, sp_elem, reason):
     with HWSimRadio(use_mlo=True) as (hapd_radio, hapd_iface), \
          HWSimRadio(use_mlo=True) as (wpas_radio, wpas_iface):
-- 
2.56.1




More information about the Hostap mailing list