aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2018-12-02 18:34:42 (GMT)
committerJouni Malinen <j@w1.fi>2018-12-02 18:42:09 (GMT)
commite49a7199d50417e8622de018ddc0536614757410 (patch)
treecb3ddeaf8675fcb30a1bacc72a1e9bf0e529830b /tests
parent698c9e202118f88537356e3ada943327082dfea3 (diff)
downloadhostap-e49a7199d50417e8622de018ddc0536614757410.zip
hostap-e49a7199d50417e8622de018ddc0536614757410.tar.gz
hostap-e49a7199d50417e8622de018ddc0536614757410.tar.bz2
tests: Opportunistic Wireless Encryption association rejection handling
Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'tests')
-rw-r--r--tests/hwsim/test_owe.py38
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/hwsim/test_owe.py b/tests/hwsim/test_owe.py
index 7ace11e..ba15fc7 100644
--- a/tests/hwsim/test_owe.py
+++ b/tests/hwsim/test_owe.py
@@ -438,3 +438,41 @@ def run_owe_group_negotiation(dev, apdev):
dev.scan_for_bss(bssid, freq="2412")
dev.connect("owe", key_mgmt="OWE")
+
+def test_owe_assoc_reject(dev, apdev):
+ """Opportunistic Wireless Encryption association rejection handling"""
+ if "OWE" not in dev[0].get_capability("key_mgmt"):
+ raise HwsimSkip("OWE not supported")
+ params = { "ssid": "owe",
+ "require_ht": "1",
+ "wpa": "2",
+ "ieee80211w": "2",
+ "wpa_key_mgmt": "OWE",
+ "rsn_pairwise": "CCMP",
+ "owe_groups": "19" }
+ hapd = hostapd.add_ap(apdev[0], params)
+ bssid = hapd.own_addr()
+
+ # First, reject two associations with HT-required (i.e., not OWE related)
+ dev[0].scan_for_bss(bssid, freq="2412")
+ dev[0].connect("owe", key_mgmt="OWE", ieee80211w="2",
+ disable_ht="1", scan_freq="2412", wait_connect=False)
+ for i in range(0,2):
+ ev = dev[0].wait_event(["CTRL-EVENT-ASSOC-REJECT"], timeout=10)
+ if ev is None:
+ raise Exception("Association rejection not reported")
+
+ # Then, verify that STA tries OWE with the default group (19) on the next
+ # attempt instead of having moved to testing another group.
+ hapd.set("require_ht", "0")
+ for i in range(0,2):
+ ev = dev[0].wait_event(["CTRL-EVENT-ASSOC-REJECT",
+ "CTRL-EVENT-CONNECTED"], timeout=10)
+ if ev is None:
+ raise Exception("Association result not reported")
+ if "CTRL-EVENT-CONNECTED" in ev:
+ break
+ if "status_code=77" in ev:
+ raise Exception("Unexpected unsupport group rejection")
+ if "CTRL-EVENT-CONNECTED" not in ev:
+ raise Exception("Did not connect successfully")