aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2014-10-18 10:03:17 (GMT)
committerJouni Malinen <j@w1.fi>2014-10-18 10:03:17 (GMT)
commit19d3a6e364557690954a4bd4468721a8442196de (patch)
treea8ad3daa166409542a40fcc4aafa50eb1fe794b3 /tests
parentbc26ac50dde37e505c66abaa5dfade41bd533a88 (diff)
downloadhostap-19d3a6e364557690954a4bd4468721a8442196de.zip
hostap-19d3a6e364557690954a4bd4468721a8442196de.tar.gz
hostap-19d3a6e364557690954a4bd4468721a8442196de.tar.bz2
tests: SAE PMKSA caching
Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'tests')
-rw-r--r--tests/hwsim/test_sae.py37
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/hwsim/test_sae.py b/tests/hwsim/test_sae.py
index 5fb5e3b..f870dd6 100644
--- a/tests/hwsim/test_sae.py
+++ b/tests/hwsim/test_sae.py
@@ -28,6 +28,43 @@ def test_sae(dev, apdev):
if dev[0].get_status_field('sae_group') != '19':
raise Exception("Expected default SAE group not used")
+def test_sae_pmksa_caching(dev, apdev):
+ """SAE and PMKSA caching"""
+ params = hostapd.wpa2_params(ssid="test-sae",
+ passphrase="12345678")
+ params['wpa_key_mgmt'] = 'SAE'
+ hapd = hostapd.add_ap(apdev[0]['ifname'], params)
+
+ dev[0].request("SET sae_groups ")
+ dev[0].connect("test-sae", psk="12345678", key_mgmt="SAE",
+ scan_freq="2412")
+ dev[0].request("DISCONNECT")
+ dev[0].request("RECONNECT")
+ ev = dev[0].wait_event(["CTRL-EVENT-CONNECTED"], timeout=15)
+ if ev is None:
+ raise Exception("Reconnect timed out")
+ if dev[0].get_status_field('sae_group') is not None:
+ raise Exception("SAE group claimed to have been used")
+
+def test_sae_pmksa_caching_disabled(dev, apdev):
+ """SAE and PMKSA caching disabled"""
+ params = hostapd.wpa2_params(ssid="test-sae",
+ passphrase="12345678")
+ params['wpa_key_mgmt'] = 'SAE'
+ params['disable_pmksa_caching'] = '1'
+ hapd = hostapd.add_ap(apdev[0]['ifname'], params)
+
+ dev[0].request("SET sae_groups ")
+ dev[0].connect("test-sae", psk="12345678", key_mgmt="SAE",
+ scan_freq="2412")
+ dev[0].request("DISCONNECT")
+ dev[0].request("RECONNECT")
+ ev = dev[0].wait_event(["CTRL-EVENT-CONNECTED"], timeout=15)
+ if ev is None:
+ raise Exception("Reconnect timed out")
+ if dev[0].get_status_field('sae_group') != '19':
+ raise Exception("Expected default SAE group not used")
+
def test_sae_groups(dev, apdev):
"""SAE with all supported groups"""
# This would be the full list of supported groups, but groups 14-16