test: FT with locally generated PMK-R0/PMK-R1 from PSK

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
This commit is contained in:
Michael Braun 2016-09-24 22:53:43 +02:00 committed by Jouni Malinen
parent 96590564d6
commit d0175d6e48

View file

@ -46,19 +46,27 @@ def ft_params(rsn=True, ssid=None, passphrase=None):
params["reassociation_deadline"] = "1000" params["reassociation_deadline"] = "1000"
return params return params
def ft_params1(rsn=True, ssid=None, passphrase=None): def ft_params1a(rsn=True, ssid=None, passphrase=None):
params = ft_params(rsn, ssid, passphrase) params = ft_params(rsn, ssid, passphrase)
params['nas_identifier'] = "nas1.w1.fi" params['nas_identifier'] = "nas1.w1.fi"
params['r1_key_holder'] = "000102030405" params['r1_key_holder'] = "000102030405"
return params
def ft_params1(rsn=True, ssid=None, passphrase=None):
params = ft_params1a(rsn, ssid, passphrase)
params['r0kh'] = [ "02:00:00:00:03:00 nas1.w1.fi 100102030405060708090a0b0c0d0e0f", params['r0kh'] = [ "02:00:00:00:03:00 nas1.w1.fi 100102030405060708090a0b0c0d0e0f",
"02:00:00:00:04:00 nas2.w1.fi 300102030405060708090a0b0c0d0e0f" ] "02:00:00:00:04:00 nas2.w1.fi 300102030405060708090a0b0c0d0e0f" ]
params['r1kh'] = "02:00:00:00:04:00 00:01:02:03:04:06 200102030405060708090a0b0c0d0e0f" params['r1kh'] = "02:00:00:00:04:00 00:01:02:03:04:06 200102030405060708090a0b0c0d0e0f"
return params return params
def ft_params2(rsn=True, ssid=None, passphrase=None): def ft_params2a(rsn=True, ssid=None, passphrase=None):
params = ft_params(rsn, ssid, passphrase) params = ft_params(rsn, ssid, passphrase)
params['nas_identifier'] = "nas2.w1.fi" params['nas_identifier'] = "nas2.w1.fi"
params['r1_key_holder'] = "000102030406" params['r1_key_holder'] = "000102030406"
return params
def ft_params2(rsn=True, ssid=None, passphrase=None):
params = ft_params2a(rsn, ssid, passphrase)
params['r0kh'] = [ "02:00:00:00:03:00 nas1.w1.fi 200102030405060708090a0b0c0d0e0f", params['r0kh'] = [ "02:00:00:00:03:00 nas1.w1.fi 200102030405060708090a0b0c0d0e0f",
"02:00:00:00:04:00 nas2.w1.fi 000102030405060708090a0b0c0d0e0f" ] "02:00:00:00:04:00 nas2.w1.fi 000102030405060708090a0b0c0d0e0f" ]
params['r1kh'] = "02:00:00:00:03:00 00:01:02:03:04:05 300102030405060708090a0b0c0d0e0f" params['r1kh'] = "02:00:00:00:03:00 00:01:02:03:04:05 300102030405060708090a0b0c0d0e0f"
@ -162,6 +170,22 @@ def test_ap_ft(dev, apdev):
if "[WPA2-FT/PSK-CCMP]" not in dev[0].request("SCAN_RESULTS"): if "[WPA2-FT/PSK-CCMP]" not in dev[0].request("SCAN_RESULTS"):
raise Exception("Scan results missing RSN element info") raise Exception("Scan results missing RSN element info")
def test_ap_ft_local_key_gen(dev, apdev):
"""WPA2-PSK-FT AP with local key generation (without pull/push)"""
ssid = "test-ft"
passphrase="12345678"
params = ft_params1a(ssid=ssid, passphrase=passphrase)
params['ft_psk_generate_local'] = "1";
hapd0 = hostapd.add_ap(apdev[0]['ifname'], params)
params = ft_params2a(ssid=ssid, passphrase=passphrase)
params['ft_psk_generate_local'] = "1";
hapd1 = hostapd.add_ap(apdev[1]['ifname'], params)
run_roams(dev[0], apdev, hapd0, hapd1, ssid, passphrase)
if "[WPA2-FT/PSK-CCMP]" not in dev[0].request("SCAN_RESULTS"):
raise Exception("Scan results missing RSN element info")
def test_ap_ft_many(dev, apdev): def test_ap_ft_many(dev, apdev):
"""WPA2-PSK-FT AP multiple times""" """WPA2-PSK-FT AP multiple times"""
ssid = "test-ft" ssid = "test-ft"