]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Wait for group key handshake before testing Michael MIC failure
authorJouni Malinen <quic_jouni@quicinc.com>
Thu, 14 Dec 2023 09:02:12 +0000 (11:02 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 14 Dec 2023 09:02:12 +0000 (11:02 +0200)
Avoid potential race condition in ap_cipher_tkip_countermeasures_ap by
sending the first test frame only after the AP has completed processing
the 4-way handshake and also wait a bit to allow the group key handshake
to be completed.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
tests/hwsim/test_ap_ciphers.py

index 72dcfa54211e8aafbd1a60f52e314ec8fc343173..5ad3e0289a9150adb33cbd582f92d4a83996bac4 100644 (file)
@@ -102,13 +102,17 @@ def test_ap_cipher_tkip_countermeasures_ap(dev, apdev):
     dev[0].connect("tkip-countermeasures", psk="12345678",
                    pairwise="TKIP", group="TKIP", scan_freq="2412")
 
+    hapd.wait_sta()
+    time.sleep(1)
     dev[0].dump_monitor()
+    hapd.note("Michael MIC failure to BSSID")
     dev[0].cmd_execute(["echo", "-n", apdev[0]['bssid'], ">", testfile],
                        shell=True)
     ev = dev[0].wait_event(["CTRL-EVENT-DISCONNECTED"], timeout=1)
     if ev is not None:
         raise Exception("Unexpected disconnection on first Michael MIC failure")
 
+    hapd.note("Michael MIC failure to broadcast")
     dev[0].cmd_execute(["echo", "-n", "ff:ff:ff:ff:ff:ff", ">", testfile],
                        shell=True)
     ev = dev[0].wait_disconnected(timeout=10,