]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: SAE-PK and PSK using invalid password combination
authorJouni Malinen <jouni@codeaurora.org>
Thu, 6 Aug 2020 22:09:06 +0000 (01:09 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 6 Aug 2020 22:09:06 +0000 (01:09 +0300)
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
tests/hwsim/test_sae_pk.py

index 540fe58c018a728d3b73e102c9c865575bec93ed..b425b90837d924fb7d4a9bf944b63f2712a65455 100644 (file)
@@ -413,3 +413,19 @@ def test_sae_pk_and_psk(dev, apdev):
     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")
+
+def test_sae_pk_and_psk_invalid_password(dev, apdev):
+    """SAE-PK and PSK using invalid password combination"""
+    check_sae_pk_capab(dev[0])
+    dev[0].flush_scan_cache()
+
+    params = hostapd.wpa2_params(ssid=SAE_PK_SSID)
+    params['wpa_key_mgmt'] = 'SAE WPA-PSK'
+    params['sae_password'] = ['%s|pk=%s:%s' % (SAE_PK_SEC3_PW,
+                                               SAE_PK_SEC3_M,
+                                               SAE_PK_19_PK)]
+    params['wpa_passphrase'] = SAE_PK_20_PW
+    hapd = hostapd.add_ap(apdev[0], params, no_enable=True)
+    res = hapd.request("ENABLE")
+    if "FAIL" not in res:
+        raise Exception("Invalid configuration accepted")