tests: SAE and password identifier with FFC

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2018-12-02 11:56:04 +02:00
parent 7e26f1bc89
commit be5e7a0771

View File

@ -1273,18 +1273,21 @@ def test_sae_connect_cmd(dev, apdev):
if ev is None: if ev is None:
raise Exception("No connection result reported") raise Exception("No connection result reported")
def test_sae_password_id(dev, apdev): def run_sae_password_id(dev, apdev, groups=None):
"""SAE and password identifier"""
if "SAE" not in dev[0].get_capability("auth_alg"): if "SAE" not in dev[0].get_capability("auth_alg"):
raise HwsimSkip("SAE not supported") raise HwsimSkip("SAE not supported")
params = hostapd.wpa2_params(ssid="test-sae") params = hostapd.wpa2_params(ssid="test-sae")
params['wpa_key_mgmt'] = 'SAE' params['wpa_key_mgmt'] = 'SAE'
if groups:
params['sae_groups'] = groups
else:
groups = ""
params['sae_password'] = [ 'secret|mac=ff:ff:ff:ff:ff:ff|id=pw id', params['sae_password'] = [ 'secret|mac=ff:ff:ff:ff:ff:ff|id=pw id',
'foo|mac=02:02:02:02:02:02', 'foo|mac=02:02:02:02:02:02',
'another secret|mac=ff:ff:ff:ff:ff:ff|id=' + 29*'A' ] 'another secret|mac=ff:ff:ff:ff:ff:ff|id=' + 29*'A' ]
hapd = hostapd.add_ap(apdev[0], params) hapd = hostapd.add_ap(apdev[0], params)
dev[0].request("SET sae_groups ") dev[0].request("SET sae_groups " + groups)
dev[0].connect("test-sae", sae_password="secret", sae_password_id="pw id", dev[0].connect("test-sae", sae_password="secret", sae_password_id="pw id",
key_mgmt="SAE", scan_freq="2412") key_mgmt="SAE", scan_freq="2412")
dev[0].request("REMOVE_NETWORK all") dev[0].request("REMOVE_NETWORK all")
@ -1307,6 +1310,18 @@ def test_sae_password_id(dev, apdev):
raise Exception("Unknown password identifier not reported") raise Exception("Unknown password identifier not reported")
dev[0].request("REMOVE_NETWORK all") dev[0].request("REMOVE_NETWORK all")
def test_sae_password_id(dev, apdev):
"""SAE and password identifier"""
run_sae_password_id(dev, apdev, "")
def test_sae_password_id_ecc(dev, apdev):
"""SAE and password identifier (ECC)"""
run_sae_password_id(dev, apdev, "19")
def test_sae_password_id_ffc(dev, apdev):
"""SAE and password identifier (FFC)"""
run_sae_password_id(dev, apdev, "22")
def test_sae_forced_anti_clogging_pw_id(dev, apdev): def test_sae_forced_anti_clogging_pw_id(dev, apdev):
"""SAE anti clogging (forced and Password Identifier)""" """SAE anti clogging (forced and Password Identifier)"""
if "SAE" not in dev[0].get_capability("auth_alg"): if "SAE" not in dev[0].get_capability("auth_alg"):