[PATCH 3/3] tests: FT with PMF and the Reassociation Response frame not acknowledged
Andrei-Alexandru Bleortu
me at andrei-z.com
Fri Oct 16 16:55:35 PDT 2026
Assisted-by: LLM
Signed-off-by: Andrei-Alexandru Bleortu <me at andrei-z.com>
---
tests/hwsim/test_ap_ft.py | 50 +++++++++++++++++++++++++++++++++++++++
1 file changed, 50 insertions(+)
diff --git a/tests/hwsim/test_ap_ft.py b/tests/hwsim/test_ap_ft.py
index 29bec3de9..9c5a797e0 100644
--- a/tests/hwsim/test_ap_ft.py
+++ b/tests/hwsim/test_ap_ft.py
@@ -561,6 +561,56 @@ def test_ap_ft_pmf(dev, apdev):
"""WPA2-PSK-FT AP with PMF"""
run_ap_ft_pmf(dev, apdev, "1")
+def test_ap_ft_pmf_reassoc_resp_no_ack(dev, apdev):
+ """FT with PMF and the Reassociation Response frame reported unacknowledged"""
+ ssid = "test-ft"
+ passphrase = "12345678"
+ params = ft_params1(ssid=ssid, passphrase=passphrase)
+ params["ieee80211w"] = "2"
+ hapd0 = hostapd.add_ap(apdev[0], params)
+ params = ft_params2(ssid=ssid, passphrase=passphrase)
+ params["ieee80211w"] = "2"
+ hapd1 = hostapd.add_ap(apdev[1], params)
+
+ dev[0].connect(ssid, psk=passphrase, key_mgmt="FT-PSK", proto="WPA2",
+ ieee80211w="2", scan_freq="2412", bssid=apdev[0]['bssid'])
+ dev[0].scan_for_bss(apdev[1]['bssid'], freq="2412")
+
+ # The STA receives the Reassociation Response frame, but its ACK is lost:
+ # the AP sees the TX status as not acknowledged.
+ hapd1.set("ext_mgmt_frame_handling", "1")
+ dev[0].request("ROAM " + apdev[1]['bssid'])
+ for stype in (11, 2):
+ for i in range(10):
+ req = hapd1.mgmt_rx()
+ if req is None:
+ raise Exception("MGMT RX wait timed out")
+ if req['subtype'] == stype:
+ break
+ else:
+ raise Exception("Frame subtype %d not received" % stype)
+ hapd1.request("MGMT_RX_PROCESS freq=2412 datarate=0 ssi_signal=-30 frame=" + binascii.hexlify(req['frame']).decode())
+ while True:
+ ev = hapd1.wait_event(["MGMT-TX-STATUS"], timeout=5)
+ if ev is None:
+ raise Exception("Management frame TX status not reported")
+ if "stype=%d" % (11 if stype == 11 else 3) in ev:
+ break
+ status = " ".join(ev.split(' ')[1:4])
+ if stype == 2:
+ status = status.replace("ok=1", "ok=0")
+ if "OK" not in hapd1.request("MGMT_TX_STATUS_PROCESS " + status):
+ raise Exception("MGMT_TX_STATUS_PROCESS failed")
+ dev[0].wait_connected()
+ hapd1.set("ext_mgmt_frame_handling", "0")
+
+ ev = dev[0].wait_event(["CTRL-EVENT-DISCONNECTED"], timeout=1)
+ if ev is not None:
+ raise Exception("STA disconnected: " + ev)
+ hwsim_utils.test_connectivity(dev[0], hapd1)
+ if "[ASSOC]" not in hapd1.get_sta(dev[0].own_addr())['flags']:
+ raise Exception("STA not associated on the AP")
+
def test_ap_ft_pmf_over_ds(dev, apdev):
"""WPA2-PSK-FT AP with PMF (over DS)"""
run_ap_ft_pmf(dev, apdev, "1", over_ds=True)
--
2.47.3
More information about the Hostap
mailing list