]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: WPA2-PSK EAPOL-Key retry limit configuration
authorJouni Malinen <jouni@qca.qualcomm.com>
Mon, 6 Feb 2017 21:59:41 +0000 (23:59 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 6 Feb 2017 22:25:36 +0000 (00:25 +0200)
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
tests/hwsim/test_ap_psk.py

index 2ca42798c15ffcfb837a853b4b6cab27816e1930..c3b62b92f47daf191e26f9e9c2ea3692692baec0 100644 (file)
@@ -2235,3 +2235,22 @@ def test_ap_wpa_psk_rsn_pairwise(dev, apdev):
     hapd = hostapd.add_ap(apdev[0], params)
     dev[0].connect("wpapsk", psk="1234567890", proto="WPA", pairwise="TKIP",
                    scan_freq="2412")
+
+def test_ap_wpa2_eapol_retry_limit(dev, apdev):
+    """WPA2-PSK EAPOL-Key retry limit configuration"""
+    ssid = "test-wpa2-psk"
+    passphrase = 'qwertyuiop'
+    params = hostapd.wpa2_params(ssid=ssid, passphrase=passphrase)
+    params['wpa_ptk_rekey'] = '2'
+    params['wpa_group_update_count'] = '1'
+    params['wpa_pairwise_update_count'] = '1'
+    hapd = hostapd.add_ap(apdev[0], params)
+    dev[0].connect(ssid, psk=passphrase, scan_freq="2412")
+    ev = dev[0].wait_event(["WPA: Key negotiation completed"])
+    if ev is None:
+        raise Exception("PTK rekey timed out")
+
+    if "FAIL" not in hapd.request("SET wpa_group_update_count 0"):
+        raise Exception("Invalid wpa_group_update_count value accepted")
+    if "FAIL" not in hapd.request("SET wpa_pairwise_update_count 0"):
+        raise Exception("Invalid wpa_pairwise_update_count value accepted")