Browse Source

tests: WPS 2.0 rejection of WEP credential

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Jouni Malinen 11 years ago
parent
commit
11d78bb1ee
2 changed files with 15 additions and 0 deletions
  1. 15 0
      tests/hwsim/test_ap_wps.py
  2. BIN
      tests/hwsim/wps-wep-cred

+ 15 - 0
tests/hwsim/test_ap_wps.py

@@ -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"

BIN
tests/hwsim/wps-wep-cred