]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: wpa_supplicant secure mesh using sae_password
authorJouni Malinen <j@w1.fi>
Fri, 13 Apr 2018 09:03:40 +0000 (12:03 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 13 Apr 2018 09:09:33 +0000 (12:09 +0300)
Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_wpas_mesh.py

index c3cfb7b0b46e0b10c2feb67c2339e1cd10c27127..7d9e0ef9af604a5c67705e64badddf7d229c38ef 100644 (file)
@@ -304,12 +304,15 @@ def _test_mesh_open_rssi_threshold(dev, apdev, value, expected):
         raise Exception("mesh_rssi_threshold should be " + str(expected) +
                         ": " + 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()
     dev.set_network(id, "mode", "5")
     dev.set_network_quoted(id, "ssid", "wpas-mesh-sec")
     dev.set_network(id, "key_mgmt", "SAE")
     dev.set_network(id, "frequency", "2412")
+    if sae_password:
+        dev.set_network_quoted(id, "sae_password", "thisismypassphrase!")
     if psk:
         dev.set_network_quoted(id, "psk", "thisismypassphrase!")
     if pmf:
@@ -349,6 +352,25 @@ def test_wpas_mesh_secure(dev, apdev):
     if state != "COMPLETED":
         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):
     """Secure mesh network connectivity with PMF enabled"""
     check_mesh_support(dev[0], secure=True)