]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Verify EAP-WSC fragmentation and mixed mode WPA+WPA2
authorJouni Malinen <j@w1.fi>
Sat, 28 Dec 2013 07:58:14 +0000 (09:58 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 29 Dec 2013 08:00:32 +0000 (10:00 +0200)
Signed-hostap: Jouni Malinen <j@w1.fi>

tests/hwsim/test_ap_wps.py

index 2c9057a1139a090811021fb4180753497eb652d8..dcab574f3f2e4266dc9b7d722616c455d3ad7204 100644 (file)
@@ -350,3 +350,30 @@ def test_ap_wps_er_add_enrollee_pbc(dev, apdev):
     if ev is None:
         raise Exception("WPS ER did not report success")
     hwsim_utils.test_connectivity_sta(dev[0], dev[1])
+
+def test_ap_wps_fragmentation(dev, apdev):
+    """WPS with fragmentation in EAP-WSC and mixed mode WPA+WPA2"""
+    ssid = "test-wps-fragmentation"
+    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",
+                     "fragment_size": "50" })
+    hapd = hostapd.Hostapd(apdev[0]['ifname'])
+    logger.info("WPS provisioning step")
+    hapd.request("WPS_PBC")
+    dev[0].request("SET ignore_old_scan_res 1")
+    dev[0].dump_monitor()
+    dev[0].request("SET wps_fragment_size 50")
+    dev[0].request("WPS_PBC")
+    ev = dev[0].wait_event(["CTRL-EVENT-CONNECTED"], timeout=30)
+    if ev is None:
+        raise Exception("Association with the AP timed out")
+    status = dev[0].get_status()
+    if status['wpa_state'] != 'COMPLETED':
+        raise Exception("Not fully connected")
+    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")