mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-01-31 09:14:03 -05:00
tests: Use run_ap_ft_pmf_bip_over_ds() for ap_ft_pmf_over_ds
No need to duplicate this functionality when all the ap_ft_pmf_*_over_ds test cases are doing practically the same thing and the no-specific-cipher-configuration case can be addressed easily with the same helper function. Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
46b8ea2105
commit
0c481b7866
@ -780,17 +780,7 @@ def test_ap_ft_over_ds_unexpected(dev, apdev):
|
|||||||
|
|
||||||
def test_ap_ft_pmf_over_ds(dev, apdev):
|
def test_ap_ft_pmf_over_ds(dev, apdev):
|
||||||
"""WPA2-PSK-FT AP over DS with PMF"""
|
"""WPA2-PSK-FT AP over DS with PMF"""
|
||||||
ssid = "test-ft"
|
run_ap_ft_pmf_bip_over_ds(dev, apdev, None)
|
||||||
passphrase="12345678"
|
|
||||||
|
|
||||||
params = ft_params1(ssid=ssid, passphrase=passphrase)
|
|
||||||
params["ieee80211w"] = "2"
|
|
||||||
hapd0 = hostapd.add_ap(apdev[0], params)
|
|
||||||
params = ft_params2(ssid=ssid, passphrase=passphrase)
|
|
||||||
params["ieee80211w"] = "2"
|
|
||||||
hapd1 = hostapd.add_ap(apdev[1], params)
|
|
||||||
|
|
||||||
run_roams(dev[0], apdev, hapd0, hapd1, ssid, passphrase, over_ds=True)
|
|
||||||
|
|
||||||
def test_ap_ft_pmf_bip_cmac_128_over_ds(dev, apdev):
|
def test_ap_ft_pmf_bip_cmac_128_over_ds(dev, apdev):
|
||||||
"""WPA2-PSK-FT AP over DS with PMF/BIP-CMAC-128"""
|
"""WPA2-PSK-FT AP over DS with PMF/BIP-CMAC-128"""
|
||||||
@ -809,7 +799,7 @@ def test_ap_ft_pmf_bip_cmac_256_over_ds(dev, apdev):
|
|||||||
run_ap_ft_pmf_bip_over_ds(dev, apdev, "BIP-CMAC-256")
|
run_ap_ft_pmf_bip_over_ds(dev, apdev, "BIP-CMAC-256")
|
||||||
|
|
||||||
def run_ap_ft_pmf_bip_over_ds(dev, apdev, cipher):
|
def run_ap_ft_pmf_bip_over_ds(dev, apdev, cipher):
|
||||||
if cipher not in dev[0].get_capability("group_mgmt"):
|
if cipher and cipher not in dev[0].get_capability("group_mgmt"):
|
||||||
raise HwsimSkip("Cipher %s not supported" % cipher)
|
raise HwsimSkip("Cipher %s not supported" % cipher)
|
||||||
|
|
||||||
ssid = "test-ft"
|
ssid = "test-ft"
|
||||||
@ -817,10 +807,12 @@ def run_ap_ft_pmf_bip_over_ds(dev, apdev, cipher):
|
|||||||
|
|
||||||
params = ft_params1(ssid=ssid, passphrase=passphrase)
|
params = ft_params1(ssid=ssid, passphrase=passphrase)
|
||||||
params["ieee80211w"] = "2"
|
params["ieee80211w"] = "2"
|
||||||
|
if cipher:
|
||||||
params["group_mgmt_cipher"] = cipher
|
params["group_mgmt_cipher"] = cipher
|
||||||
hapd0 = hostapd.add_ap(apdev[0], params)
|
hapd0 = hostapd.add_ap(apdev[0], params)
|
||||||
params = ft_params2(ssid=ssid, passphrase=passphrase)
|
params = ft_params2(ssid=ssid, passphrase=passphrase)
|
||||||
params["ieee80211w"] = "2"
|
params["ieee80211w"] = "2"
|
||||||
|
if cipher:
|
||||||
params["group_mgmt_cipher"] = cipher
|
params["group_mgmt_cipher"] = cipher
|
||||||
hapd1 = hostapd.add_ap(apdev[1], params)
|
hapd1 = hostapd.add_ap(apdev[1], params)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user