From 61ec2353f8b65102b73b20c2218391bdc5d9412f Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Wed, 24 Jul 2019 12:59:45 +0300 Subject: [PATCH] tests: AKM suite selector reporting Signed-off-by: Jouni Malinen --- tests/hwsim/test_sae.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/hwsim/test_sae.py b/tests/hwsim/test_sae.py index 57079df06..b04ed8f22 100644 --- a/tests/hwsim/test_sae.py +++ b/tests/hwsim/test_sae.py @@ -105,12 +105,18 @@ def test_sae_pmksa_caching(dev, apdev): ev = hapd.wait_event(["AP-STA-CONNECTED"], timeout=5) if ev is None: raise Exception("No connection event received from hostapd") + sta0 = hapd.get_sta(dev[0].own_addr()) + if sta0['wpa'] != '2' or sta0['AKMSuiteSelector'] != '00-0f-ac-8': + raise Exception("SAE STA(0) AKM suite selector reported incorrectly") dev[0].request("DISCONNECT") dev[0].wait_disconnected() dev[0].request("RECONNECT") dev[0].wait_connected(timeout=15, error="Reconnect timed out") if dev[0].get_status_field('sae_group') is not None: raise Exception("SAE group claimed to have been used") + sta0 = hapd.get_sta(dev[0].own_addr()) + if sta0['wpa'] != '2' or sta0['AKMSuiteSelector'] != '00-0f-ac-8': + raise Exception("SAE STA(0) AKM suite selector reported incorrectly after PMKSA caching") @remote_compatible def test_sae_pmksa_caching_disabled(dev, apdev): @@ -271,13 +277,19 @@ def test_sae_mixed(dev, apdev): params = hostapd.wpa2_params(ssid="test-sae", passphrase="12345678") params['wpa_key_mgmt'] = 'SAE WPA-PSK' params['sae_anti_clogging_threshold'] = '0' - hostapd.add_ap(apdev[0], params) + hapd = hostapd.add_ap(apdev[0], params) dev[2].connect("test-sae", psk="12345678", scan_freq="2412") for i in range(0, 2): dev[i].request("SET sae_groups ") dev[i].connect("test-sae", psk="12345678", key_mgmt="SAE", scan_freq="2412") + sta0 = hapd.get_sta(dev[0].own_addr()) + sta2 = hapd.get_sta(dev[2].own_addr()) + if sta0['wpa'] != '2' or sta0['AKMSuiteSelector'] != '00-0f-ac-8': + raise Exception("SAE STA(0) AKM suite selector reported incorrectly") + if sta2['wpa'] != '2' or sta2['AKMSuiteSelector'] != '00-0f-ac-2': + raise Exception("PSK STA(2) AKM suite selector reported incorrectly") def test_sae_and_psk(dev, apdev): """SAE and PSK enabled in network profile""" -- 2.39.2