aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <jouni@codeaurora.org>2019-12-07 10:56:19 (GMT)
committerJouni Malinen <j@w1.fi>2019-12-07 10:56:19 (GMT)
commit250db2ab518b362b896ff4f4b7fd7222c152fe3a (patch)
tree619e0535a5eb9dd9462f28d75796ad2ac2b3f9a6
parent1325655397846b4d389ef5701013c3db8f0d0503 (diff)
downloadhostap-250db2ab518b362b896ff4f4b7fd7222c152fe3a.zip
hostap-250db2ab518b362b896ff4f4b7fd7222c152fe3a.tar.gz
hostap-250db2ab518b362b896ff4f4b7fd7222c152fe3a.tar.bz2
tests: SAE H2E and RSNXE mismatch (AP detecting)
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
-rw-r--r--tests/hwsim/test_sae.py57
1 files changed, 57 insertions, 0 deletions
diff --git a/tests/hwsim/test_sae.py b/tests/hwsim/test_sae.py
index 386bcbb..29e2ebb 100644
--- a/tests/hwsim/test_sae.py
+++ b/tests/hwsim/test_sae.py
@@ -2105,3 +2105,60 @@ def test_sae_auth_restart(dev, apdev):
finally:
dev[0].set("sae_groups", "")
dev[0].set("sae_pwe", "0")
+
+def test_sae_h2e_rsnxe_mismatch(dev, apdev):
+ """SAE H2E and RSNXE mismatch in EAPOL-Key msg 2/4"""
+ 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")
+ for rsnxe in ["F40100", "F400", ""]:
+ 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)
+ dev[0].request("REMOVE_NETWORK all")
+ if ev is None:
+ raise Exception("No disconnection seen")
+ if "CTRL-EVENT-DISCONNECTED" not in ev:
+ raise Exception("Unexpected connection")
+ 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")
+ 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")
+ for rsnxe in ["F40100", "F400", ""]:
+ dev[0].set("rsnxe_override_assoc", rsnxe)
+ dev[0].set("rsnxe_override_eapol", "F40120")
+ 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)
+ dev[0].request("REMOVE_NETWORK all")
+ if ev is None:
+ raise Exception("No disconnection seen")
+ if "CTRL-EVENT-DISCONNECTED" not in ev:
+ raise Exception("Unexpected connection")
+ dev[0].dump_monitor()
+ finally:
+ dev[0].set("sae_groups", "")
+ dev[0].set("sae_pwe", "0")