tests: FT-EAP and PMKSA caching for initial mobility domain association

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
This commit is contained in:
Jouni Malinen 2019-04-28 16:03:03 +03:00 committed by Jouni Malinen
parent 9083ef1355
commit 9ff2b85e73
2 changed files with 55 additions and 2 deletions

View file

@ -149,6 +149,8 @@ def run_roams(dev, apdev, hapd0, hapd1, ssid, passphrase, over_ds=False,
if ocv: if ocv:
copts["ocv"] = ocv copts["ocv"] = ocv
if eap: if eap:
if pmksa_caching:
copts["ft_eap_pmksa_caching"] = "1"
if also_non_ft: if also_non_ft:
copts["key_mgmt"] = "WPA-EAP-SUITE-B-192 FT-EAP-SHA384" if sha384 else "WPA-EAP FT-EAP" copts["key_mgmt"] = "WPA-EAP-SUITE-B-192 FT-EAP-SHA384" if sha384 else "WPA-EAP FT-EAP"
else: else:
@ -174,12 +176,16 @@ def run_roams(dev, apdev, hapd0, hapd1, ssid, passphrase, over_ds=False,
dev.request("DISCONNECT") dev.request("DISCONNECT")
dev.wait_disconnected() dev.wait_disconnected()
dev.request("RECONNECT") dev.request("RECONNECT")
ev = dev.wait_event(["CTRL-EVENT-CONNECTED", "CTRL-EVENT-DISCONNECTED"], ev = dev.wait_event(["CTRL-EVENT-CONNECTED",
"CTRL-EVENT-DISCONNECTED",
"CTRL-EVENT-EAP-STARTED"],
timeout=15) timeout=15)
if ev is None: if ev is None:
raise Exception("Reconnect timed out") raise Exception("Reconnect timed out")
if "CTRL-EVENT-DISCONNECTED" in ev: if "CTRL-EVENT-DISCONNECTED" in ev:
raise Exception("Unexpected disconnection after RECONNECT") raise Exception("Unexpected disconnection after RECONNECT")
if "CTRL-EVENT-EAP-STARTED" in ev:
raise Exception("Unexpected EAP start after RECONNECT")
if dev.get_status_field('bssid') == apdev[0]['bssid']: if dev.get_status_field('bssid') == apdev[0]['bssid']:
ap1 = apdev[0] ap1 = apdev[0]
@ -2845,3 +2851,49 @@ def test_ap_ft_roam_rrm(dev, apdev):
dev[0].scan_for_bss(bssid0, freq=2412) dev[0].scan_for_bss(bssid0, freq=2412)
dev[0].roam(bssid0) dev[0].roam(bssid0)
check_beacon_req(hapd0, addr, 3) check_beacon_req(hapd0, addr, 3)
def test_ap_ft_pmksa_caching(dev, apdev):
"""FT-EAP and PMKSA caching for initial mobility domain association"""
ssid = "test-ft"
identity = "gpsk user"
radius = hostapd.radius_params()
params = ft_params1(ssid=ssid)
params['wpa_key_mgmt'] = "FT-EAP"
params["ieee8021x"] = "1"
params["mobility_domain"] = "c3d4"
params = dict(list(radius.items()) + list(params.items()))
hapd = hostapd.add_ap(apdev[0], params)
params = ft_params2(ssid=ssid)
params['wpa_key_mgmt'] = "FT-EAP"
params["ieee8021x"] = "1"
params["mobility_domain"] = "c3d4"
params = dict(list(radius.items()) + list(params.items()))
hapd1 = hostapd.add_ap(apdev[1], params)
run_roams(dev[0], apdev, hapd, hapd1, ssid, None, eap=True,
eap_identity=identity, pmksa_caching=True)
def test_ap_ft_pmksa_caching_sha384(dev, apdev):
"""FT-EAP-SHA384 and PMKSA caching for initial mobility domain association"""
ssid = "test-ft"
identity = "gpsk user"
radius = hostapd.radius_params()
params = ft_params1(ssid=ssid)
params['wpa_key_mgmt'] = "FT-EAP-SHA384"
params["ieee8021x"] = "1"
params["mobility_domain"] = "c3d4"
params = dict(list(radius.items()) + list(params.items()))
hapd = hostapd.add_ap(apdev[0], params)
params = ft_params2(ssid=ssid)
params['wpa_key_mgmt'] = "FT-EAP-SHA384"
params["ieee8021x"] = "1"
params["mobility_domain"] = "c3d4"
params = dict(list(radius.items()) + list(params.items()))
hapd1 = hostapd.add_ap(apdev[1], params)
run_roams(dev[0], apdev, hapd, hapd1, ssid, None, eap=True,
eap_identity=identity, pmksa_caching=True, sha384=True)

View file

@ -1084,7 +1084,8 @@ class WpaSupplicant:
"dpp_netaccesskey", "dpp_netaccesskey_expiry", "dpp_netaccesskey", "dpp_netaccesskey_expiry",
"group_mgmt", "owe_group", "group_mgmt", "owe_group",
"roaming_consortium_selection", "ocv", "roaming_consortium_selection", "ocv",
"multi_ap_backhaul_sta", "rx_stbc", "tx_stbc"] "multi_ap_backhaul_sta", "rx_stbc", "tx_stbc",
"ft_eap_pmksa_caching"]
for field in not_quoted: for field in not_quoted:
if field in kwargs and kwargs[field]: if field in kwargs and kwargs[field]:
self.set_network(id, field, kwargs[field]) self.set_network(id, field, kwargs[field])