From 60c435493de3d82f5d9e39cf73548611eba34883 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 15 Mar 2020 11:16:22 +0200 Subject: [PATCH] tests: SAE and RSNE mismatch in EAPOL-Key msg 2/4 Signed-off-by: Jouni Malinen --- tests/hwsim/test_sae.py | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/tests/hwsim/test_sae.py b/tests/hwsim/test_sae.py index fff4f49ae..255d42c48 100644 --- a/tests/hwsim/test_sae.py +++ b/tests/hwsim/test_sae.py @@ -2150,6 +2150,42 @@ def test_sae_auth_restart(dev, apdev): dev[0].set("sae_groups", "") dev[0].set("sae_pwe", "0") +def test_sae_rsne_mismatch(dev, apdev): + """SAE and RSNE mismatch in EAPOL-Key msg 2/4""" + check_sae_capab(dev[0]) + dev[0].set("sae_groups", "") + + params = hostapd.wpa2_params(ssid="sae-pwe", passphrase="12345678") + params['wpa_key_mgmt'] = 'SAE' + hapd = hostapd.add_ap(apdev[0], params) + + # First, test with matching RSNE to confirm testing capability + dev[0].set("rsne_override_eapol", + "30140100000fac040100000fac040100000fac080000") + dev[0].connect("sae-pwe", psk="12345678", key_mgmt="SAE", + scan_freq="2412") + dev[0].request("REMOVE_NETWORK all") + dev[0].wait_disconnected() + dev[0].dump_monitor() + + # Then, test with modified RSNE + tests = ["30140100000fac040100000fac040100000fac080010", "0000"] + for ie in tests: + dev[0].set("rsne_override_eapol", ie) + 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() + def test_sae_h2e_rsnxe_mismatch(dev, apdev): """SAE H2E and RSNXE mismatch in EAPOL-Key msg 2/4""" check_sae_capab(dev[0])