]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: WPS 2.0 rejection of WEP credential
authorJouni Malinen <jouni@qca.qualcomm.com>
Wed, 5 Mar 2014 10:36:20 +0000 (12:36 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 5 Mar 2014 10:40:54 +0000 (12:40 +0200)
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
tests/hwsim/test_ap_wps.py
tests/hwsim/wps-wep-cred [new file with mode: 0644]

index ee82f6ec2a390f24d2496784145d7a7b0a8ef732..db0c387286f62ed698c4900a10087e763cec3ae4 100644 (file)
@@ -958,6 +958,21 @@ def test_ap_wps_wep_config(dev, apdev):
     if "Peer Address: " + dev[0].p2p_interface_addr() not in status:
         raise Exception("Peer address not shown correctly")
 
+def test_ap_wps_wep_enroll(dev, apdev):
+    """WPS 2.0 STA rejecting WEP configuration"""
+    ssid = "test-wps-wep"
+    hostapd.add_ap(apdev[0]['ifname'],
+                   { "ssid": ssid, "eap_server": "1", "wps_state": "2",
+                     "skip_cred_build": "1", "extra_cred": "wps-wep-cred" })
+    hapd = hostapd.Hostapd(apdev[0]['ifname'])
+    hapd.request("WPS_PBC")
+    dev[0].request("WPS_PBC")
+    ev = dev[0].wait_event(["WPS-FAIL"], timeout=15)
+    if ev is None:
+        raise Exception("WPS-FAIL event timed out")
+    if "msg=12" not in ev or "reason=2 (WEP Prohibited)" not in ev:
+        raise Exception("Unexpected WPS-FAIL event: " + ev)
+
 def test_ap_wps_ie_fragmentation(dev, apdev):
     """WPS AP using fragmented WPS IE"""
     ssid = "test-wps-ie-fragmentation"
diff --git a/tests/hwsim/wps-wep-cred b/tests/hwsim/wps-wep-cred
new file mode 100644 (file)
index 0000000..407cf41
Binary files /dev/null and b/tests/hwsim/wps-wep-cred differ