From 064a46b47886deafe226d6c1938bbbfe4e7c9497 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Tue, 20 Aug 2024 19:31:00 +0300 Subject: [PATCH] tests: RSN overriding and WPA3-Personal Compatibility Mode Signed-off-by: Jouni Malinen --- tests/hwsim/test_rsn_override.py | 66 ++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/tests/hwsim/test_rsn_override.py b/tests/hwsim/test_rsn_override.py index 62419f2c9..d0a2d30af 100644 --- a/tests/hwsim/test_rsn_override.py +++ b/tests/hwsim/test_rsn_override.py @@ -346,3 +346,69 @@ def test_rsn_override_sta_only(dev, apdev): scan_freq="2412") finally: dev[0].set("rsn_overriding", "0") + +def test_rsn_override_compatibility_mode(dev, apdev): + """RSN overriding and WPA3-Personal Compatibility Mode""" + check_sae_capab(dev[0]) + + ssid = "test-rsn-override" + params = hostapd.wpa2_params(ssid=ssid, + passphrase="12345678") + params['rsn_override_key_mgmt'] = 'SAE' + params['rsn_override_key_mgmt_2'] = 'SAE-EXT-KEY' + params['rsn_override_pairwise'] = 'CCMP' + params['rsn_override_pairwise_2'] = 'GCMP-256' + params['rsn_override_mfp'] = '2' + params['rsn_override_mfp_2'] = '2' + params['beacon_prot'] = '1' + params['sae_groups'] = '19 20' + params['sae_require_mfp'] = '1' + params['sae_pwe'] = '2' + hapd = hostapd.add_ap(apdev[0], params) + bssid = hapd.own_addr() + + try: + logger.info("RSN overriding capable STA using RSNO2E") + dev[0].set("rsn_overriding", "1") + dev[0].scan_for_bss(bssid, freq=2412) + dev[0].set("sae_pwe", "2") + dev[0].set("sae_groups", "") + dev[0].connect(ssid, sae_password="12345678", + pairwise="GCMP-256", key_mgmt="SAE-EXT-KEY", + ieee80211w="2", scan_freq="2412") + hapd.wait_sta() + dev[0].request("REMOVE_NETWORK all") + dev[0].wait_disconnected() + hapd.wait_sta_disconnect() + + logger.info("RSN overriding capable STA using RSNOE") + dev[0].set("sae_pwe", "0") + dev[0].connect(ssid, sae_password="12345678", + pairwise="CCMP", key_mgmt="SAE", + ieee80211w="2", scan_freq="2412") + hapd.wait_sta() + dev[0].request("REMOVE_NETWORK all") + dev[0].wait_disconnected() + hapd.wait_sta_disconnect() + + logger.info("RSN overriding capable STA using RSNE") + dev[0].connect(ssid, psk="12345678", + pairwise="CCMP", key_mgmt="WPA-PSK", + ieee80211w="0", scan_freq="2412") + hapd.wait_sta() + dev[0].request("REMOVE_NETWORK all") + dev[0].wait_disconnected() + hapd.wait_sta_disconnect() + + logger.info("RSN overriding uncapable STA using RSNE") + dev[0].set("rsn_overriding", "0") + dev[0].connect(ssid, psk="12345678", + pairwise="CCMP", key_mgmt="WPA-PSK", + ieee80211w="0", scan_freq="2412") + hapd.wait_sta() + dev[0].request("REMOVE_NETWORK all") + dev[0].wait_disconnected() + hapd.wait_sta_disconnect() + finally: + dev[0].set("sae_pwe", "0") + dev[0].set("rsn_overriding", "0")