]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: AKM suite selector reporting
authorJouni Malinen <jouni@codeaurora.org>
Wed, 24 Jul 2019 09:59:45 +0000 (12:59 +0300)
committerJouni Malinen <j@w1.fi>
Wed, 24 Jul 2019 09:59:45 +0000 (12:59 +0300)
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
tests/hwsim/test_sae.py

index 57079df06dec4ed51e56834dc636b4e2bebd0ac9..b04ed8f225f4512d424acd6ac1311cb7a8a57e98 100644 (file)
@@ -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"""