]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: AP may discard FT ReassocReq in ap_ft_sae_h2e_downgrade_attack
authorJouni Malinen <jouni@codeaurora.org>
Tue, 14 Apr 2020 13:36:07 +0000 (16:36 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 14 Apr 2020 13:37:35 +0000 (16:37 +0300)
This is in preparation for a hostapd implementation change on how to
address the unexpected RSNXE Used field value in FTE during FT
reassociation.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
tests/hwsim/test_ap_ft.py

index a7a71711a658af7031ccba930240cd49c10726a8..abc9431e8b40a91a7ab9d5310bd32a97f38769ac 100644 (file)
@@ -1080,10 +1080,17 @@ def test_ap_ft_sae_h2e_downgrade_attack(dev, apdev):
                   force_initial_conn_to_first_ap=True,
                   return_after_initial=True)
         dev[0].scan_for_bss(hapd1.own_addr(), freq="2412")
-        dev[0].request("ROAM " + hapd1.own_addr())
-        ev = dev[0].wait_event(["CTRL-EVENT-ASSOC-REJECT"], timeout=10)
-        if ev is None:
-            raise Exception("Association not rejected")
+        if "OK" not in dev[0].request("ROAM " + hapd1.own_addr()):
+            raise Exception("ROAM command failed")
+        # The target AP is expected to discard Reassociation Response frame due
+        # to RSNXE Used mismatch. This will result in roaming timeout and
+        # returning back to the old AP.
+        ev = dev[0].wait_event(["CTRL-EVENT-ASSOC-REJECT",
+                                "CTRL-EVENT-CONNECTED"], timeout=10)
+        if ev and "CTRL-EVENT-ASSOC-REJECT" in ev:
+            pass
+        elif ev and hapd1.own_addr() in ev:
+            raise Exception("Roaming succeeded unexpectedly")
     finally:
         dev[0].set("sae_pwe", "0")