From e60be3b3d4afa94fe9bd61b73be0442071bb44b8 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Mon, 19 Jan 2015 18:39:13 +0200 Subject: [PATCH] tests: WPS registrar learning configuration from WPA+WPA2 AP Signed-off-by: Jouni Malinen --- tests/hwsim/test_ap_wps.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/hwsim/test_ap_wps.py b/tests/hwsim/test_ap_wps.py index 59f12b524..dd9814876 100644 --- a/tests/hwsim/test_ap_wps.py +++ b/tests/hwsim/test_ap_wps.py @@ -456,6 +456,27 @@ def test_ap_wps_reg_connect(dev, apdev): if status['key_mgmt'] != 'WPA2-PSK': raise Exception("Unexpected key_mgmt") +def test_ap_wps_reg_connect_mixed_mode(dev, apdev): + """WPS registrar using AP PIN to connect (WPA+WPA2)""" + ssid = "test-wps-reg-ap-pin" + appin = "12345670" + hostapd.add_ap(apdev[0]['ifname'], + { "ssid": ssid, "eap_server": "1", "wps_state": "2", + "wpa_passphrase": "12345678", "wpa": "3", + "wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP", + "wpa_pairwise": "TKIP", "ap_pin": appin}) + dev[0].scan_for_bss(apdev[0]['bssid'], freq=2412) + dev[0].wps_reg(apdev[0]['bssid'], appin) + status = dev[0].get_status() + if status['wpa_state'] != 'COMPLETED' or status['bssid'] != apdev[0]['bssid']: + raise Exception("Not fully connected") + if status['ssid'] != ssid: + raise Exception("Unexpected SSID") + if status['pairwise_cipher'] != 'CCMP' or status['group_cipher'] != 'TKIP': + raise Exception("Unexpected encryption configuration") + if status['key_mgmt'] != 'WPA2-PSK': + raise Exception("Unexpected key_mgmt") + def check_wps_reg_failure(dev, ap, appin): dev.request("WPS_REG " + ap['bssid'] + " " + appin) ev = dev.wait_event(["WPS-SUCCESS", "WPS-FAIL"], timeout=15)