tests: Verify SAE anti-clogging mechanism

Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2013-12-29 12:24:25 +02:00
parent 3a88914d8e
commit a6cf5cd655
2 changed files with 24 additions and 1 deletions

View file

@ -63,3 +63,24 @@ def test_sae_group_nego(dev, apdev):
scan_freq="2412") scan_freq="2412")
if dev[0].get_status_field('sae_group') != '19': if dev[0].get_status_field('sae_group') != '19':
raise Exception("Expected SAE group not used") raise Exception("Expected SAE group not used")
def test_sae_anti_clogging(dev, apdev):
"""SAE anti clogging"""
params = hostapd.wpa2_params(ssid="test-sae", passphrase="12345678")
params['wpa_key_mgmt'] = 'SAE'
params['sae_anti_clogging_threshold'] = '1'
hostapd.add_ap(apdev[0]['ifname'], params)
dev[0].request("SET sae_groups ")
dev[1].request("SET sae_groups ")
id = {}
for i in range(0, 2):
dev[i].scan(freq="2412")
id[i] = dev[i].connect("test-sae", psk="12345678", key_mgmt="SAE",
scan_freq="2412", only_add_network=True)
for i in range(0, 2):
dev[i].select_network(id[i])
for i in range(0, 2):
ev = dev[i].wait_event(["CTRL-EVENT-CONNECTED"], timeout=10)
if ev is None:
raise Exception("Association with the AP timed out")

View file

@ -533,7 +533,7 @@ class WpaSupplicant:
password=None, phase1=None, phase2=None, ca_cert=None, password=None, phase1=None, phase2=None, ca_cert=None,
domain_suffix_match=None, password_hex=None, domain_suffix_match=None, password_hex=None,
client_cert=None, private_key=None, peerkey=False, client_cert=None, private_key=None, peerkey=False,
wait_connect=True): wait_connect=True, only_add_network=False):
logger.info("Connect STA " + self.ifname + " to AP") logger.info("Connect STA " + self.ifname + " to AP")
id = self.add_network() id = self.add_network()
self.set_network_quoted(id, "ssid", ssid) self.set_network_quoted(id, "ssid", ssid)
@ -579,6 +579,8 @@ class WpaSupplicant:
domain_suffix_match) domain_suffix_match)
if peerkey: if peerkey:
self.set_network(id, "peerkey", "1") self.set_network(id, "peerkey", "1")
if only_add_network:
return id
if wait_connect: if wait_connect:
self.connect_network(id) self.connect_network(id)
else: else: