]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: WPS PIN provisioning with configured AP using dummy cred
authorJouni Malinen <j@w1.fi>
Tue, 27 Dec 2016 17:59:22 +0000 (19:59 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 28 Dec 2016 12:31:42 +0000 (14:31 +0200)
Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_ap_wps.py

index 4f1d0ec03787bf26f88eef0ee455fbad2cd6860c..ba013d1939b8e6e07cb1742d0d72fbb19503612b 100644 (file)
@@ -9815,3 +9815,24 @@ def test_ap_wps_tkip(dev, apdev):
                             "wpa_passphrase": "12345678" })
     if "FAIL" not in hapd.request("WPS_PBC"):
         raise Exception("WPS unexpectedly enabled")
+
+def test_ap_wps_conf_dummy_cred(dev, apdev):
+    """WPS PIN provisioning with configured AP using dummy cred"""
+    ssid = "test-wps-conf"
+    hapd = hostapd.add_ap(apdev[0],
+                          { "ssid": ssid, "eap_server": "1", "wps_state": "2",
+                          "wpa_passphrase": "12345678", "wpa": "2",
+                          "wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP"})
+    hapd.request("WPS_PIN any 12345670")
+    dev[0].scan_for_bss(apdev[0]['bssid'], freq="2412")
+    dev[0].dump_monitor()
+    try:
+        hapd.set("wps_testing_dummy_cred", "1")
+        dev[0].request("WPS_PIN " + apdev[0]['bssid'] + " 12345670")
+        for i in range(1, 3):
+            ev = dev[0].wait_event(["WPS-CRED-RECEIVED"], timeout=15)
+            if ev is None:
+                raise Exception("WPS credential %d not received" % i)
+        dev[0].wait_connected(timeout=30)
+    finally:
+        hapd.set("wps_testing_dummy_cred", "0")