]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Extend ap_pmf_inject_auth to cover injection of AssocReq
authorJouni Malinen <j@w1.fi>
Sun, 28 Jul 2019 20:51:39 +0000 (23:51 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 28 Jul 2019 20:51:39 +0000 (23:51 +0300)
Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_ap_pmf.py

index 62f0947ffeab8406f5a6a2c75f202396e5a5ea34..a825330ab724c3dac922e7eea444c4958d52beae 100644 (file)
@@ -562,6 +562,20 @@ def test_ap_pmf_inject_auth(dev, apdev):
     hapd.request("SET ext_mgmt_frame_handling 0")
     if "OK" not in res:
         raise Exception("MGMT_RX_PROCESS failed")
+    time.sleep(0.1)
+
+    # Verify that original association is still functional.
+    hwsim_utils.test_connectivity(dev[0], hapd)
+
+    # Inject an unprotected Association Request frame claiming to be from the
+    # associated STA.
+    auth = "00003a01" + bssid + addr + bssid + '2000' + '31040500' + '0008746573742d706d66' + '010802040b160c121824' + '301a0100000fac040100000fac040100000fac06c0000000000fac06'
+    hapd.request("SET ext_mgmt_frame_handling 1")
+    res = hapd.request("MGMT_RX_PROCESS freq=2412 datarate=0 ssi_signal=-30 frame=%s" % auth)
+    hapd.request("SET ext_mgmt_frame_handling 0")
+    if "OK" not in res:
+        raise Exception("MGMT_RX_PROCESS failed")
+    time.sleep(5)
 
     # Verify that original association is still functional.
     hwsim_utils.test_connectivity(dev[0], hapd)