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)