tests: wpa_supplicant secure mesh using sae_password

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2018-04-13 12:03:40 +03:00
parent d5906fbb72
commit f75ed521a5

View file

@ -304,12 +304,15 @@ def _test_mesh_open_rssi_threshold(dev, apdev, value, expected):
raise Exception("mesh_rssi_threshold should be " + str(expected) + raise Exception("mesh_rssi_threshold should be " + str(expected) +
": " + str(mesh_rssi_threshold)) ": " + str(mesh_rssi_threshold))
def add_mesh_secure_net(dev, psk=True, pmf=False, pairwise=None, group=None): def add_mesh_secure_net(dev, psk=True, pmf=False, pairwise=None, group=None,
sae_password=False):
id = dev.add_network() id = dev.add_network()
dev.set_network(id, "mode", "5") dev.set_network(id, "mode", "5")
dev.set_network_quoted(id, "ssid", "wpas-mesh-sec") dev.set_network_quoted(id, "ssid", "wpas-mesh-sec")
dev.set_network(id, "key_mgmt", "SAE") dev.set_network(id, "key_mgmt", "SAE")
dev.set_network(id, "frequency", "2412") dev.set_network(id, "frequency", "2412")
if sae_password:
dev.set_network_quoted(id, "sae_password", "thisismypassphrase!")
if psk: if psk:
dev.set_network_quoted(id, "psk", "thisismypassphrase!") dev.set_network_quoted(id, "psk", "thisismypassphrase!")
if pmf: if pmf:
@ -349,6 +352,25 @@ def test_wpas_mesh_secure(dev, apdev):
if state != "COMPLETED": if state != "COMPLETED":
raise Exception("Unexpected wpa_state on dev1: " + state) raise Exception("Unexpected wpa_state on dev1: " + state)
def test_wpas_mesh_secure_sae_password(dev, apdev):
"""wpa_supplicant secure mesh using sae_password"""
check_mesh_support(dev[0], secure=True)
dev[0].request("SET sae_groups ")
id = add_mesh_secure_net(dev[0], psk=False, sae_password=True)
dev[0].mesh_group_add(id)
dev[1].request("SET sae_groups ")
id = add_mesh_secure_net(dev[1])
dev[1].mesh_group_add(id)
check_mesh_group_added(dev[0])
check_mesh_group_added(dev[1])
check_mesh_peer_connected(dev[0])
check_mesh_peer_connected(dev[1])
hwsim_utils.test_connectivity(dev[0], dev[1])
def test_mesh_secure_pmf(dev, apdev): def test_mesh_secure_pmf(dev, apdev):
"""Secure mesh network connectivity with PMF enabled""" """Secure mesh network connectivity with PMF enabled"""
check_mesh_support(dev[0], secure=True) check_mesh_support(dev[0], secure=True)