tests: SAE with sae_password

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2017-10-11 23:10:03 +03:00 committed by Jouni Malinen
parent a34ca59e4d
commit 606ef7d328
2 changed files with 45 additions and 1 deletions

View file

@ -1033,3 +1033,47 @@ def test_sae_invalid_anti_clogging_token_req(dev, apdev):
dev[0].dump_monitor() dev[0].dump_monitor()
dev[0].request("DISCONNECT") dev[0].request("DISCONNECT")
def test_sae_password(dev, apdev):
"""SAE and sae_password in hostapd configuration"""
if "SAE" not in dev[0].get_capability("auth_alg"):
raise HwsimSkip("SAE not supported")
params = hostapd.wpa2_params(ssid="test-sae",
passphrase="12345678")
params['wpa_key_mgmt'] = 'SAE WPA-PSK'
params['sae_password'] = "sae-password"
hapd = hostapd.add_ap(apdev[0], params)
dev[0].request("SET sae_groups ")
dev[0].connect("test-sae", psk="sae-password", key_mgmt="SAE",
scan_freq="2412")
dev[1].connect("test-sae", psk="12345678", scan_freq="2412")
dev[2].request("SET sae_groups ")
dev[2].connect("test-sae", sae_password="sae-password", key_mgmt="SAE",
scan_freq="2412")
def test_sae_password_short(dev, apdev):
"""SAE and short password"""
if "SAE" not in dev[0].get_capability("auth_alg"):
raise HwsimSkip("SAE not supported")
params = hostapd.wpa2_params(ssid="test-sae")
params['wpa_key_mgmt'] = 'SAE'
params['sae_password'] = "secret"
hapd = hostapd.add_ap(apdev[0], params)
dev[0].request("SET sae_groups ")
dev[0].connect("test-sae", sae_password="secret", key_mgmt="SAE",
scan_freq="2412")
def test_sae_password_long(dev, apdev):
"""SAE and long password"""
if "SAE" not in dev[0].get_capability("auth_alg"):
raise HwsimSkip("SAE not supported")
params = hostapd.wpa2_params(ssid="test-sae")
params['wpa_key_mgmt'] = 'SAE'
params['sae_password'] = 100*"A"
hapd = hostapd.add_ap(apdev[0], params)
dev[0].request("SET sae_groups ")
dev[0].connect("test-sae", sae_password=100*"A", key_mgmt="SAE",
scan_freq="2412")

View file

@ -1010,7 +1010,7 @@ class WpaSupplicant:
"private_key2", "phase1", "phase2", "domain_suffix_match", "private_key2", "phase1", "phase2", "domain_suffix_match",
"altsubject_match", "subject_match", "pac_file", "dh_file", "altsubject_match", "subject_match", "pac_file", "dh_file",
"bgscan", "ht_mcs", "id_str", "openssl_ciphers", "bgscan", "ht_mcs", "id_str", "openssl_ciphers",
"domain_match", "dpp_connector" ] "domain_match", "dpp_connector", "sae_password" ]
for field in quoted: for field in quoted:
if field in kwargs and kwargs[field]: if field in kwargs and kwargs[field]:
self.set_network_quoted(id, field, kwargs[field]) self.set_network_quoted(id, field, kwargs[field])