From a0fd2ae643a63198f30c509363679af6c2cbee74 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Fri, 29 Aug 2014 20:13:35 +0300 Subject: [PATCH] tests: WPS mixed-WPA/WPA2 credential merging Signed-off-by: Jouni Malinen --- tests/hwsim/test_ap_wps.py | 23 +++++++++++++++++++++++ tests/hwsim/wps-mixed-cred | Bin 0 -> 112 bytes 2 files changed, 23 insertions(+) create mode 100644 tests/hwsim/wps-mixed-cred diff --git a/tests/hwsim/test_ap_wps.py b/tests/hwsim/test_ap_wps.py index 5fbfacc46..77b0ae52a 100644 --- a/tests/hwsim/test_ap_wps.py +++ b/tests/hwsim/test_ap_wps.py @@ -2102,3 +2102,26 @@ def test_ap_wps_disabled(dev, apdev): raise Exception("WPS_PBC succeeded unexpectedly") if "FAIL" not in hapd.request("WPS_CANCEL"): raise Exception("WPS_CANCEL succeeded unexpectedly") + +def test_ap_wps_mixed_cred(dev, apdev): + """WPS 2.0 STA merging mixed mode WPA/WPA2 credentials""" + 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-mixed-cred" }) + hapd = hostapd.Hostapd(apdev[0]['ifname']) + hapd.request("WPS_PBC") + dev[0].request("WPS_PBC") + ev = dev[0].wait_event(["WPS-SUCCESS"], timeout=15) + if ev is None: + raise Exception("WPS-SUCCESS event timed out") + nets = dev[0].list_networks() + if len(nets) != 1: + raise Exception("Unexpected number of network blocks") + id = nets[0]['id'] + proto = dev[0].get_network(id, "proto") + if proto != "WPA RSN": + raise Exception("Unexpected merged proto field value: " + proto) + pairwise = dev[0].get_network(id, "pairwise") + if pairwise != "CCMP TKIP": + raise Exception("Unexpected merged pairwise field value: " + pairwise) diff --git a/tests/hwsim/wps-mixed-cred b/tests/hwsim/wps-mixed-cred new file mode 100644 index 0000000000000000000000000000000000000000..fca2871fd210166d0ad045ed574fcdbb21ca2cb6 GIT binary patch literal 112 zcmWgOV=xg=V_;+yaAjZ#Ni8lBU}j)qU=rX5k}LumAPIE_4nrej6H_yD3jqZNHYNrT O5WuQW0j!S$k3IleJ_<_! literal 0 HcmV?d00001