]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: SAE H2E and rejected groups indication (unexpected group)
authorJouni Malinen <jouni@codeaurora.org>
Fri, 6 Dec 2019 22:45:10 +0000 (00:45 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 6 Dec 2019 22:45:10 +0000 (00:45 +0200)
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
tests/hwsim/test_sae.py

index 95bf43fb71eb2ff1d7456f84c7812756d98fa470..386bcbb9b1c0749879c2dedbe9574cf12541e799 100644 (file)
@@ -2024,6 +2024,30 @@ def test_sae_h2e_rejected_groups(dev, apdev):
         dev[0].set("sae_groups", "")
         dev[0].set("sae_pwe", "0")
 
+def test_sae_h2e_rejected_groups_unexpected(dev, apdev):
+    """SAE H2E and rejected groups indication (unexpected group)"""
+    params = hostapd.wpa2_params(ssid="sae-pwe", passphrase="12345678")
+    params['wpa_key_mgmt'] = 'SAE'
+    params['sae_groups'] = "19 20"
+    params['sae_pwe'] = "1"
+    hapd = hostapd.add_ap(apdev[0], params)
+    try:
+        dev[0].set("sae_groups", "21 19")
+        dev[0].set("extra_sae_rejected_groups", "19")
+        dev[0].set("sae_pwe", "1")
+        dev[0].connect("sae-pwe", psk="12345678", key_mgmt="SAE",
+                       scan_freq="2412", wait_connect=False)
+        ev = dev[0].wait_event(["CTRL-EVENT-CONNECTED",
+                                "CTRL-EVENT-SSID-TEMP-DISABLED"], timeout=10)
+        dev[0].request("DISCONNECT")
+        if ev is None:
+            raise Exception("No indication of temporary disabled network seen")
+        if "CTRL-EVENT-CONNECTED" in ev:
+            raise Exception("Unexpected connection")
+    finally:
+        dev[0].set("sae_groups", "")
+        dev[0].set("sae_pwe", "0")
+
 def test_sae_h2e_password_id(dev, apdev):
     """SAE H2E and password identifier"""
     if "SAE" not in dev[0].get_capability("auth_alg"):