tests: Replace sae_pk_only with sae_pk to match implementation

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
This commit is contained in:
Jouni Malinen 2020-06-07 11:53:00 +03:00 committed by Jouni Malinen
parent 9ad010c290
commit 5ee94a997e
2 changed files with 31 additions and 4 deletions

View file

@ -156,7 +156,7 @@ def test_sae_pk_only(dev, apdev):
params['sae_password'] = pw
hapd = hostapd.add_ap(apdev[0], params)
dev[0].connect(ssid, sae_password=pw, key_mgmt="SAE", sae_pk_only="1",
dev[0].connect(ssid, sae_password=pw, key_mgmt="SAE", sae_pk="1",
scan_freq="2412", wait_connect=False)
ev = dev[0].wait_event(["CTRL-EVENT-CONNECTED",
"CTRL-EVENT-NETWORK-NOT-FOUND"], timeout=10)
@ -181,6 +181,33 @@ def test_sae_pk_only(dev, apdev):
if dev[0].get_status_field("sae_pk") != "1":
raise Exception("SAE-PK was not used")
def test_sae_pk_modes(dev, apdev):
"""SAE-PK modes"""
check_sae_pk_capab(dev[0])
dev[0].set("sae_groups", "")
ssid = "SAE-PK test"
pw = "dwxm-zv66-p5ue"
m = "431ff8322f93b9dc50ded9f3d14ace22"
pk = "MHcCAQEEIAJIGlfnteonDb7rQyP/SGQjwzrZAnfrXIm4280VWajYoAoGCCqGSM49AwEHoUQDQgAEeRkstKQV+FSAMqBayqFknn2nAQsdsh/MhdX6tiHOTAFin/sUMFRMyspPtIu7YvlKdsexhI0jPVhaYZn1jKWhZg=="
params = hostapd.wpa2_params(ssid=ssid)
params['wpa_key_mgmt'] = 'SAE'
params["ieee80211w"] = "2"
params['sae_password'] = ['%s|pk=%s:%s' % (pw, m, pk)]
hapd = hostapd.add_ap(apdev[0], params)
tests = [(2, 0), (1, 1), (0, 1)]
for sae_pk, expected in tests:
dev[0].connect(ssid, sae_password=pw, key_mgmt="SAE",
sae_pk=str(sae_pk), ieee80211w="2", scan_freq="2412")
val = dev[0].get_status_field("sae_pk")
if val != str(expected):
raise Exception("Unexpected sae_pk=%d result %s" % (sae_pk, val))
dev[0].request("REMOVE_NETWORK *")
dev[0].wait_disconnected()
dev[0].dump_monitor()
def test_sae_pk_transition_disable(dev, apdev):
"""SAE-PK transition disable indication"""
check_sae_pk_capab(dev[0])
@ -204,6 +231,6 @@ def test_sae_pk_transition_disable(dev, apdev):
if ev.split(' ')[1] != "02":
raise Exception("Unexpected transition disable bitmap: " + ev)
val = dev[0].get_network(id, "sae_pk_only")
val = dev[0].get_network(id, "sae_pk")
if val != "1":
raise Exception("Unexpected sae_pk_only value: " + str(val))
raise Exception("Unexpected sae_pk value: " + str(val))

View file

@ -1102,7 +1102,7 @@ class WpaSupplicant:
"dpp_netaccesskey", "dpp_netaccesskey_expiry", "dpp_pfs",
"group_mgmt", "owe_group", "owe_only",
"owe_ptk_workaround",
"transition_disable", "sae_pk_only",
"transition_disable", "sae_pk",
"roaming_consortium_selection", "ocv",
"multi_ap_backhaul_sta", "rx_stbc", "tx_stbc",
"ft_eap_pmksa_caching", "beacon_prot",