tests: WPA2-EAP-FT with SHA384 using REASSOCIATE

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
This commit is contained in:
Jouni Malinen 2019-03-28 01:12:59 +02:00
parent 6d77014e71
commit 659f7954f4

View file

@ -133,7 +133,8 @@ def run_roams(dev, apdev, hapd0, hapd1, ssid, passphrase, over_ds=False,
test_connectivity=True, eap_identity="gpsk user", conndev=False, test_connectivity=True, eap_identity="gpsk user", conndev=False,
force_initial_conn_to_first_ap=False, sha384=False, force_initial_conn_to_first_ap=False, sha384=False,
group_mgmt=None, ocv=None, sae_password=None, group_mgmt=None, ocv=None, sae_password=None,
sae_password_id=None, sae_and_psk=False, pmksa_caching=False): sae_password_id=None, sae_and_psk=False, pmksa_caching=False,
roam_with_reassoc=False, also_non_ft=False):
logger.info("Connect to first AP") logger.info("Connect to first AP")
copts = {} copts = {}
@ -148,7 +149,10 @@ 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:
copts["key_mgmt"] = "FT-EAP-SHA384" if sha384 else "FT-EAP" if also_non_ft:
copts["key_mgmt"] = "WPA-EAP-SUITE-B-192 FT-EAP-SHA384" if sha384 else "WPA-EAP FT-EAP"
else:
copts["key_mgmt"] = "FT-EAP-SHA384" if sha384 else "FT-EAP"
copts["eap"] = "GPSK" copts["eap"] = "GPSK"
copts["identity"] = eap_identity copts["identity"] = eap_identity
copts["password"] = "abcdefghijklmnop0123456789abcdef" copts["password"] = "abcdefghijklmnop0123456789abcdef"
@ -165,7 +169,7 @@ def run_roams(dev, apdev, hapd0, hapd1, ssid, passphrase, over_ds=False,
copts["sae_password_id"] = sae_password_id copts["sae_password_id"] = sae_password_id
if force_initial_conn_to_first_ap: if force_initial_conn_to_first_ap:
copts["bssid"] = apdev[0]['bssid'] copts["bssid"] = apdev[0]['bssid']
dev.connect(ssid, **copts) netw = dev.connect(ssid, **copts)
if pmksa_caching: if pmksa_caching:
dev.request("DISCONNECT") dev.request("DISCONNECT")
dev.wait_disconnected() dev.wait_disconnected()
@ -200,7 +204,11 @@ def run_roams(dev, apdev, hapd0, hapd1, ssid, passphrase, over_ds=False,
# set later. # set later.
time.sleep(0.01) time.sleep(0.01)
logger.info("Roam to the second AP") logger.info("Roam to the second AP")
if over_ds: if roam_with_reassoc:
dev.set_network(netw, "bssid", ap2['bssid'])
dev.request("REASSOCIATE")
dev.wait_connected()
elif over_ds:
dev.roam_over_ds(ap2['bssid'], fail_test=fail_test) dev.roam_over_ds(ap2['bssid'], fail_test=fail_test)
else: else:
dev.roam(ap2['bssid'], fail_test=fail_test) dev.roam(ap2['bssid'], fail_test=fail_test)
@ -218,7 +226,11 @@ def run_roams(dev, apdev, hapd0, hapd1, ssid, passphrase, over_ds=False,
# set later. # set later.
time.sleep(0.01) time.sleep(0.01)
logger.info("Roam back to the first AP") logger.info("Roam back to the first AP")
if over_ds: if roam_with_reassoc:
dev.set_network(netw, "bssid", ap1['bssid'])
dev.request("REASSOCIATE")
dev.wait_connected()
elif over_ds:
dev.roam_over_ds(ap1['bssid']) dev.roam_over_ds(ap1['bssid'])
else: else:
dev.roam(ap1['bssid']) dev.roam(ap1['bssid'])
@ -2707,6 +2719,28 @@ def test_ap_ft_eap_sha384(dev, apdev):
run_roams(dev[0], apdev, hapd0, hapd1, ssid, passphrase, eap=True, run_roams(dev[0], apdev, hapd0, hapd1, ssid, passphrase, eap=True,
sha384=True) sha384=True)
def test_ap_ft_eap_sha384_reassoc(dev, apdev):
"""WPA2-EAP-FT with SHA384 using REASSOCIATE"""
ssid = "test-ft"
passphrase = "12345678"
radius = hostapd.radius_params()
params = ft_params1(ssid=ssid, passphrase=passphrase)
params["ieee80211w"] = "2"
params['wpa_key_mgmt'] = "WPA-EAP-SUITE-B-192 FT-EAP-SHA384"
params["ieee8021x"] = "1"
params = dict(list(radius.items()) + list(params.items()))
hapd0 = hostapd.add_ap(apdev[0], params)
params = ft_params2(ssid=ssid, passphrase=passphrase)
params["ieee80211w"] = "2"
params['wpa_key_mgmt'] = "WPA-EAP-SUITE-B-192 FT-EAP-SHA384"
params["ieee8021x"] = "1"
params = dict(list(radius.items()) + list(params.items()))
hapd1 = hostapd.add_ap(apdev[1], params)
run_roams(dev[0], apdev, hapd0, hapd1, ssid, passphrase, eap=True,
sha384=True, also_non_ft=True, roam_with_reassoc=True)
def test_ap_ft_eap_sha384_over_ds(dev, apdev): def test_ap_ft_eap_sha384_over_ds(dev, apdev):
"""WPA2-EAP-FT with SHA384 over DS""" """WPA2-EAP-FT with SHA384 over DS"""
ssid = "test-ft" ssid = "test-ft"