]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Verify SAE-PK use more explicitly
authorJouni Malinen <jouni@codeaurora.org>
Sat, 6 Jun 2020 09:10:41 +0000 (12:10 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 6 Jun 2020 12:18:13 +0000 (15:18 +0300)
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
tests/hwsim/test_sae_pk.py

index c024312fd0df0349baee91afd6badea7f6f999e9..e6b707ed77bd2e633b09b2a33571180cc38dd20b 100644 (file)
@@ -22,6 +22,10 @@ def run_sae_pk(apdev, dev, ssid, pw, m, pk, ap_groups=None):
         raise Exception("Could not get BSS flags from BSS table")
     if "[SAE-H2E]" not in bss['flags'] or "[SAE-PK]" not in bss['flags']:
         raise Exception("Unexpected BSS flags: " + bss['flags'])
+    status = dev.get_status()
+    if "sae_h2e" not in status or "sae_pk" not in status or \
+       status["sae_h2e"] != "1" or status["sae_pk"] != "1":
+        raise Exception("SAE-PK or H2E not indicated in STATUS")
     dev.request("REMOVE_NETWORK *")
     dev.wait_disconnected()
     hapd.disable()
@@ -134,6 +138,8 @@ def test_sae_pk_password_without_pk(dev, apdev):
     hapd = hostapd.add_ap(apdev[0], params)
 
     dev[0].connect(ssid, sae_password=pw, key_mgmt="SAE", scan_freq="2412")
+    if dev[0].get_status_field("sae_pk") != "0":
+        raise Exception("Unexpected sae_pk STATUS value")
 
 def test_sae_pk_only(dev, apdev):
     """SAE-PK only"""
@@ -172,3 +178,5 @@ def test_sae_pk_only(dev, apdev):
     ev = dev[0].wait_connected()
     if bssid2 not in ev:
         raise Exception("Unexpected connection BSSID")
+    if dev[0].get_status_field("sae_pk") != "1":
+        raise Exception("SAE-PK was not used")