]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: WPS+SAE+H2E
authorJouni Malinen <jouni@codeaurora.org>
Tue, 3 Aug 2021 21:22:07 +0000 (00:22 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 3 Aug 2021 21:41:30 +0000 (00:41 +0300)
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
tests/hwsim/test_ap_wps.py

index a07ed60b821860c535bea3e2ef4108317e363e60..4a5083bef49d137bb8e7fbd4d6fd84074f0af1ea 100644 (file)
@@ -10429,6 +10429,39 @@ def run_ap_wps_conf_and_sae(dev, apdev):
     dev[1].connect(ssid, psk="12345678", scan_freq="2412", proto="WPA2",
                    key_mgmt="WPA-PSK", ieee80211w="0")
 
+def test_ap_wps_conf_and_sae_h2e(dev, apdev):
+    """WPS PIN provisioning with configured AP using PSK+SAE(H2E)"""
+    try:
+        run_ap_wps_conf_and_sae_h2e(dev, apdev)
+    finally:
+        dev[0].set("wps_cred_add_sae", "0")
+        dev[0].set("sae_pwe", "0")
+
+def run_ap_wps_conf_and_sae_h2e(dev, apdev):
+    check_sae_capab(dev[0])
+    ssid = "test-wps-conf-sae"
+    hapd = hostapd.add_ap(apdev[0],
+                          {"ssid": ssid, "eap_server": "1", "wps_state": "2",
+                           "wpa_passphrase": "12345678", "wpa": "2",
+                           "ieee80211w": "1", "sae_require_mfp": "1",
+                           "sae_pwe": "1",
+                           "wpa_key_mgmt": "WPA-PSK SAE",
+                           "rsn_pairwise": "CCMP"})
+
+    dev[0].set("wps_cred_add_sae", "1")
+    dev[0].set("sae_pwe", "1")
+    dev[0].request("SET sae_groups ")
+    dev[0].scan_for_bss(apdev[0]['bssid'], freq="2412")
+    pin = dev[0].wps_read_pin()
+    hapd.request("WPS_PIN any " + pin)
+    dev[0].request("WPS_PIN " + apdev[0]['bssid'] + " " + pin)
+    dev[0].wait_connected(timeout=30)
+    status = dev[0].get_status()
+    if status['key_mgmt'] != "SAE":
+        raise Exception("SAE not used")
+    if 'pmf' not in status or status['pmf'] != "1":
+        raise Exception("PMF not enabled")
+
 def test_ap_wps_reg_config_and_sae(dev, apdev):
     """WPS registrar configuring an AP using AP PIN and using PSK+SAE"""
     try: