]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: SAE H2E and RSNXE mismatch in EAPOL-Key msg 2/4 retries
authorJouni Malinen <jouni@codeaurora.org>
Fri, 13 Dec 2019 01:27:25 +0000 (03:27 +0200)
committerJouni Malinen <jouni@codeaurora.org>
Fri, 13 Dec 2019 01:27:25 +0000 (03:27 +0200)
The second round may use PMKSA caching, but AP will need to reject msg
2/4 in that case as well due to RSNXE mismatch.

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

index 98659dfe2477b9ac73bbc22391ee6e1cb2b29a85..7e9120c35509750a73478867160e84371249ef7a 100644 (file)
@@ -2142,6 +2142,41 @@ def test_sae_h2e_rsnxe_mismatch(dev, apdev):
         dev[0].set("sae_groups", "")
         dev[0].set("sae_pwe", "0")
 
+def test_sae_h2e_rsnxe_mismatch_retries(dev, apdev):
+    """SAE H2E and RSNXE mismatch in EAPOL-Key msg 2/4 retries"""
+    params = hostapd.wpa2_params(ssid="sae-pwe", passphrase="12345678")
+    params['wpa_key_mgmt'] = 'SAE'
+    params['sae_pwe'] = "1"
+    hapd = hostapd.add_ap(apdev[0], params)
+    try:
+        dev[0].set("sae_groups", "19")
+        dev[0].set("sae_pwe", "1")
+        rsnxe = "F40100"
+        dev[0].set("rsnxe_override_eapol", rsnxe)
+        dev[0].connect("sae-pwe", psk="12345678", key_mgmt="SAE",
+                       scan_freq="2412", wait_connect=False)
+        ev = dev[0].wait_event(["Associated with"], timeout=10)
+        if ev is None:
+            raise Exception("No indication of association seen")
+        ev = dev[0].wait_event(["CTRL-EVENT-CONNECTED",
+                                "CTRL-EVENT-DISCONNECTED"], timeout=5)
+        if ev is None:
+            raise Exception("No disconnection seen")
+        if "CTRL-EVENT-DISCONNECTED" not in ev:
+            raise Exception("Unexpected connection")
+
+        ev = dev[0].wait_event(["CTRL-EVENT-CONNECTED",
+                                "CTRL-EVENT-DISCONNECTED"], timeout=10)
+        if ev is None:
+            raise Exception("No disconnection seen (2)")
+        if "CTRL-EVENT-DISCONNECTED" not in ev:
+            raise Exception("Unexpected connection (2)")
+
+        dev[0].dump_monitor()
+    finally:
+        dev[0].set("sae_groups", "")
+        dev[0].set("sae_pwe", "0")
+
 def test_sae_h2e_rsnxe_mismatch_assoc(dev, apdev):
     """SAE H2E and RSNXE mismatch in EAPOL-Key msg 2/4 (assoc)"""
     params = hostapd.wpa2_params(ssid="sae-pwe", passphrase="12345678")