diff options
author | Jouni Malinen <jouni@codeaurora.org> | 2019-12-07 14:54:20 (GMT) |
---|---|---|
committer | Jouni Malinen <j@w1.fi> | 2019-12-07 15:46:44 (GMT) |
commit | 63585099d6d9df2d6e9fe6fc9ec7be8eb5acbc82 (patch) | |
tree | b5d72d7152648e547a178110531179df862f7bf8 | |
parent | f2c4b44b40c29d52d9b398500f1f55015e56a857 (diff) | |
download | hostap-63585099d6d9df2d6e9fe6fc9ec7be8eb5acbc82.zip hostap-63585099d6d9df2d6e9fe6fc9ec7be8eb5acbc82.tar.gz hostap-63585099d6d9df2d6e9fe6fc9ec7be8eb5acbc82.tar.bz2 |
tests: SAE H2E and RSNXE mismatch in EAPOL-Key msg 3/4
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
-rw-r--r-- | tests/hwsim/test_sae.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/hwsim/test_sae.py b/tests/hwsim/test_sae.py index 29e2ebb..dbf630f 100644 --- a/tests/hwsim/test_sae.py +++ b/tests/hwsim/test_sae.py @@ -2162,3 +2162,36 @@ def test_sae_h2e_rsnxe_mismatch_assoc(dev, apdev): finally: dev[0].set("sae_groups", "") dev[0].set("sae_pwe", "0") + +def test_sae_h2e_rsnxe_mismatch_ap(dev, apdev): + """SAE H2E and RSNXE mismatch in EAPOL-Key msg 3/4""" + run_sae_h2e_rsnxe_mismatch_ap(dev, apdev, "F40100") + +def test_sae_h2e_rsnxe_mismatch_ap2(dev, apdev): + """SAE H2E and RSNXE mismatch in EAPOL-Key msg 3/4""" + run_sae_h2e_rsnxe_mismatch_ap(dev, apdev, "F400") + +def run_sae_h2e_rsnxe_mismatch_ap(dev, apdev, rsnxe): + params = hostapd.wpa2_params(ssid="sae-pwe", passphrase="12345678") + params['wpa_key_mgmt'] = 'SAE' + params['sae_pwe'] = "1" + params['rsnxe_override_eapol'] = rsnxe + hapd = hostapd.add_ap(apdev[0], params) + try: + dev[0].set("sae_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(["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") + finally: + dev[0].set("sae_groups", "") + dev[0].set("sae_pwe", "0") |