From ddf026b1c6e825e99a931b9769045f50afa198ab Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Tue, 31 Oct 2023 16:07:36 +0200 Subject: [PATCH] tests: HE AP MBSSID with mixed security (WPA2-Personal + WPA3-Personal) Signed-off-by: Jouni Malinen --- tests/hwsim/test_he_mbssid.py | 38 ++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/tests/hwsim/test_he_mbssid.py b/tests/hwsim/test_he_mbssid.py index 8474f70a0..73e187263 100644 --- a/tests/hwsim/test_he_mbssid.py +++ b/tests/hwsim/test_he_mbssid.py @@ -71,7 +71,8 @@ def mbssid_write_bss_params(f, ifname, idx, params=None): if field in params: f.write("%s=%s\n" % (field, params[field])) -def mbssid_start_ap(dev, apdev, params, fname, ifname, sta_params): +def mbssid_start_ap(dev, apdev, params, fname, ifname, sta_params, + sta_params2=None): pid = params['prefix'] + ".hostapd.pid" cmd = ['../../hostapd/hostapd', '-dtSB', '-dt', '-P', pid, '-f', params['prefix'] + ".hostapd-log", fname] @@ -103,6 +104,11 @@ def mbssid_start_ap(dev, apdev, params, fname, ifname, sta_params): raise Exception("Missing STA flag: HE") dev[0].request("DISCONNECT") + if sta_params2: + dev[0].wait_disconnected() + dev[0].connect("bss-1", **sta_params2) + dev[0].request("DISCONNECT") + if "OK" not in hapd.request("TERMINATE"): raise Exception("Failed to terminate hostapd process") ev = hapd.wait_event(["CTRL-EVENT-TERMINATING"], timeout=15) @@ -219,6 +225,36 @@ def test_he_ap_mbssid_mixed_security2(dev, apdev, params): subprocess.call(['ip', 'link', 'set', 'dev', apdev[0]['ifname'], 'address', apdev[0]['bssid']]) +def test_he_ap_mbssid_mixed_security3(dev, apdev, params): + """HE AP MBSSID with mixed security (WPA2-Personal + WPA3-Personal)""" + f, fname, ifname = mbssid_create_cfg_file(apdev, params) + + psk_params = {"wpa": "2", "wpa_passphrase": "12345678", + "wpa_pairwise": "CCMP", "wpa_key_mgmt": "WPA-PSK"} + + sae_params = {"wpa": "2", "wpa_passphrase": "12345678", + "wpa_pairwise": "CCMP", "wpa_key_mgmt": "SAE", + "sae_pwe": "1", "ieee80211w": "2"} + + mbssid_write_bss_params(f, ifname, 0, psk_params) + mbssid_write_bss_params(f, ifname, 1, sae_params) + + f.close() + + try: + dev[0].set("sae_pwe", "1") + dev[0].set("sae_groups", "") + sta_params = {"psk": "12345678", "key_mgmt": "WPA-PSK", + "pairwise": "CCMP", "group": "CCMP", "scan_freq": "2412"} + sta_params2 = {"psk": "12345678", "key_mgmt": "SAE", "ieee80211w": "2", + "pairwise": "CCMP", "group": "CCMP", "scan_freq": "2412"} + mbssid_start_ap(dev, apdev, params, fname, ifname, sta_params, + sta_params2) + finally: + dev[0].set("sae_pwe", "0") + subprocess.call(['ip', 'link', 'set', 'dev', apdev[0]['ifname'], + 'address', apdev[0]['bssid']]) + def test_he_ap_ema(dev, apdev, params): """HE EMA AP""" f, fname, ifname = mbssid_create_cfg_file(apdev, params, 2)