]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: SAE and authentication restarts with H2E/looping
authorJouni Malinen <jouni@codeaurora.org>
Fri, 25 Oct 2019 12:57:47 +0000 (15:57 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 25 Oct 2019 16:29:53 +0000 (19:29 +0300)
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
tests/hwsim/test_sae.py

index 81512ceab263747c9090ef5c3042918c5a3e4633..8f53d06e32ac2f12c087381e0496ec83cb89dbcc 100644 (file)
@@ -1874,3 +1874,33 @@ def test_sae_h2e_password_id(dev, apdev):
     finally:
         dev[0].set("sae_groups", "")
         dev[0].set("sae_pwe", "0")
+
+def test_sae_auth_restart(dev, apdev):
+    """SAE and authentication restarts with H2E/looping"""
+    if "SAE" not in dev[0].get_capability("auth_alg"):
+        raise HwsimSkip("SAE not supported")
+    params = hostapd.wpa2_params(ssid="test-sae")
+    params['wpa_key_mgmt'] = 'SAE'
+    params['sae_pwe'] = '2'
+    params['sae_password'] = 'secret|id=pw id'
+    hapd = hostapd.add_ap(apdev[0], params)
+
+    try:
+        dev[0].request("SET sae_groups ")
+        for pwe in [1, 0, 1]:
+            dev[0].set("sae_pwe", str(pwe))
+            dev[0].connect("test-sae", sae_password="secret",
+                           sae_password_id="pw id",
+                           key_mgmt="SAE", scan_freq="2412")
+            # Disconnect without hostapd removing the STA entry so that the
+            # following SAE authentication instance starts with an existing
+            # STA entry that has maintained some SAE state.
+            hapd.set("ext_mgmt_frame_handling", "1")
+            dev[0].request("REMOVE_NETWORK all")
+            req = hapd.mgmt_rx()
+            dev[0].wait_disconnected()
+            dev[0].dump_monitor()
+            hapd.set("ext_mgmt_frame_handling", "0")
+    finally:
+        dev[0].set("sae_groups", "")
+        dev[0].set("sae_pwe", "0")