tests: DPP PFS

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
This commit is contained in:
Jouni Malinen 2020-03-28 15:05:57 +02:00 committed by Jouni Malinen
parent 5058f771d9
commit e96d319140
2 changed files with 62 additions and 1 deletions

View file

@ -5178,3 +5178,64 @@ def test_dpp_chirp_configurator_inits(dev, apdev):
dev[1].dpp_auth_init(uri=uri, conf="sta-dpp", configurator=conf_id) dev[1].dpp_auth_init(uri=uri, conf="sta-dpp", configurator=conf_id)
wait_auth_success(dev[0], dev[1], dev[1], dev[0]) wait_auth_success(dev[0], dev[1], dev[1], dev[0])
def start_dpp_pfs_ap(apdev, pfs):
params = {"ssid": "dpp",
"wpa": "2",
"wpa_key_mgmt": "DPP",
"dpp_pfs": str(pfs),
"ieee80211w": "2",
"rsn_pairwise": "CCMP",
"dpp_connector": params1_ap_connector,
"dpp_csign": params1_csign,
"dpp_netaccesskey": params1_ap_netaccesskey}
try:
hapd = hostapd.add_ap(apdev, params)
except:
raise HwsimSkip("DPP not supported")
return hapd
def run_dpp_pfs_sta(dev, pfs, fail=False):
dev.connect("dpp", key_mgmt="DPP", scan_freq="2412",
ieee80211w="2", dpp_pfs=str(pfs),
dpp_csign=params1_csign,
dpp_connector=params1_sta_connector,
dpp_netaccesskey=params1_sta_netaccesskey,
wait_connect=not fail)
if fail:
for i in range(2):
ev = dev.wait_event(["CTRL-EVENT-ASSOC-REJECT",
"CTRL-EVENT-CONNECTED"], timeout=10)
if ev is None:
raise Exception("Connection result not reported")
if "CTRL-EVENT-CONNECTED" in ev:
raise Exception("Unexpected connection")
dev.request("REMOVE_NETWORK all")
else:
dev.request("REMOVE_NETWORK all")
dev.wait_disconnected()
dev.dump_monitor()
def test_dpp_pfs_ap_0(dev, apdev):
"""DPP PFS AP default"""
check_dpp_capab(dev[0])
hapd = start_dpp_pfs_ap(apdev[0], 0)
run_dpp_pfs_sta(dev[0], 0)
run_dpp_pfs_sta(dev[0], 1)
run_dpp_pfs_sta(dev[0], 2)
def test_dpp_pfs_ap_1(dev, apdev):
"""DPP PFS AP required"""
check_dpp_capab(dev[0])
hapd = start_dpp_pfs_ap(apdev[0], 1)
run_dpp_pfs_sta(dev[0], 0)
run_dpp_pfs_sta(dev[0], 1)
run_dpp_pfs_sta(dev[0], 2, fail=True)
def test_dpp_pfs_ap_2(dev, apdev):
"""DPP PFS AP not allowed"""
check_dpp_capab(dev[0])
hapd = start_dpp_pfs_ap(apdev[0], 2)
run_dpp_pfs_sta(dev[0], 0)
run_dpp_pfs_sta(dev[0], 1, fail=True)
run_dpp_pfs_sta(dev[0], 2)

View file

@ -1099,7 +1099,7 @@ class WpaSupplicant:
"bssid_whitelist", "mem_only_psk", "eap_workaround", "bssid_whitelist", "mem_only_psk", "eap_workaround",
"engine", "fils_dh_group", "bssid_hint", "engine", "fils_dh_group", "bssid_hint",
"dpp_csign", "dpp_csign_expiry", "dpp_csign", "dpp_csign_expiry",
"dpp_netaccesskey", "dpp_netaccesskey_expiry", "dpp_netaccesskey", "dpp_netaccesskey_expiry", "dpp_pfs",
"group_mgmt", "owe_group", "owe_only", "group_mgmt", "owe_group", "owe_only",
"owe_ptk_workaround", "owe_ptk_workaround",
"roaming_consortium_selection", "ocv", "roaming_consortium_selection", "ocv",