From 11d78bb1eebe2433fe0bcbdb283a6dc062b13fe8 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Wed, 5 Mar 2014 12:36:20 +0200 Subject: [PATCH] tests: WPS 2.0 rejection of WEP credential Signed-off-by: Jouni Malinen --- tests/hwsim/test_ap_wps.py | 15 +++++++++++++++ tests/hwsim/wps-wep-cred | Bin 0 -> 53 bytes 2 files changed, 15 insertions(+) create mode 100644 tests/hwsim/wps-wep-cred diff --git a/tests/hwsim/test_ap_wps.py b/tests/hwsim/test_ap_wps.py index ee82f6ec2..db0c38728 100644 --- a/tests/hwsim/test_ap_wps.py +++ b/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" diff --git a/tests/hwsim/wps-wep-cred b/tests/hwsim/wps-wep-cred new file mode 100644 index 0000000000000000000000000000000000000000..407cf4143ba154802f7abe4e93375061c7f09ef3 GIT binary patch literal 53 zcmWgOV=xp@V_;+yaAjZ#Ni8lBU}j)qU=-j7l1u^`APIE_){NAgoO}TV1~w)J5C8y` CHwAnE literal 0 HcmV?d00001