]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Opportunistic Wireless Encryption (OWE)
authorJouni Malinen <j@w1.fi>
Sat, 11 Mar 2017 22:48:19 +0000 (00:48 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 12 Mar 2017 18:44:09 +0000 (20:44 +0200)
Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/example-hostapd.config
tests/hwsim/example-wpa_supplicant.config
tests/hwsim/test_owe.py [new file with mode: 0644]

index 70af7b1a4ca935a95c68f575bc3a4450e37664a2..2c8509b54ddaa8dd4cdce7fd870b15575e9a512e 100644 (file)
@@ -105,3 +105,4 @@ CONFIG_MBO=y
 CONFIG_IAPP=y
 CONFIG_TAXONOMY=y
 CONFIG_FILS=y
+CONFIG_OWE=y
index b615d3ebec23b665d183845508fccc1a19945ad0..a1acdc0955fb58a25e85bfb7de33a4be2b63418a 100644 (file)
@@ -148,3 +148,4 @@ CONFIG_SUITEB=y
 CONFIG_MBO=y
 CONFIG_FILS=y
 CONFIG_PMKSA_CACHE_EXTERNAL=y
+CONFIG_OWE=y
diff --git a/tests/hwsim/test_owe.py b/tests/hwsim/test_owe.py
new file mode 100644 (file)
index 0000000..068f3bc
--- /dev/null
@@ -0,0 +1,48 @@
+# Test cases for Opportunistic Wireless Encryption (OWE)
+# Copyright (c) 2017, Jouni Malinen <j@w1.fi>
+#
+# This software may be distributed under the terms of the BSD license.
+# See README for more details.
+
+import hostapd
+import hwsim_utils
+from utils import HwsimSkip
+
+def test_owe(dev, apdev):
+    """Opportunistic Wireless Encryption"""
+    if "OWE" not in dev[0].get_capability("key_mgmt"):
+        raise HwsimSkip("OWE not supported")
+    params = { "ssid": "owe",
+               "wpa": "2",
+               "wpa_key_mgmt": "OWE",
+               "rsn_pairwise": "CCMP" }
+    hapd = hostapd.add_ap(apdev[0], params)
+    bssid = hapd.own_addr()
+
+    dev[0].scan_for_bss(bssid, freq="2412")
+    bss = dev[0].get_bss(bssid)
+    if "[WPA2-OWE-CCMP]" not in bss['flags']:
+        raise Exception("OWE AKM not recognized: " + bss['flags'])
+
+    dev[0].connect("owe", key_mgmt="OWE")
+    hwsim_utils.test_connectivity(dev[0], hapd)
+
+def test_owe_and_psk(dev, apdev):
+    """Opportunistic Wireless Encryption and WPA2-PSK enabled"""
+    if "OWE" not in dev[0].get_capability("key_mgmt"):
+        raise HwsimSkip("OWE not supported")
+    params = { "ssid": "owe+psk",
+               "wpa": "2",
+               "wpa_key_mgmt": "OWE WPA-PSK",
+               "rsn_pairwise": "CCMP",
+               "wpa_passphrase": "12345678" }
+    hapd = hostapd.add_ap(apdev[0], params)
+    bssid = hapd.own_addr()
+
+    dev[0].scan_for_bss(bssid, freq="2412")
+    dev[0].connect("owe+psk", psk="12345678")
+    hwsim_utils.test_connectivity(dev[0], hapd)
+
+    dev[1].scan_for_bss(bssid, freq="2412")
+    dev[1].connect("owe+psk", key_mgmt="OWE")
+    hwsim_utils.test_connectivity(dev[1], hapd)