]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Too many EAP roundtrips (server)
authorJouni Malinen <j@w1.fi>
Sun, 1 Sep 2019 12:59:34 +0000 (15:59 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 1 Sep 2019 14:19:35 +0000 (17:19 +0300)
Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_ap_eap.py

index 7e18065634d371525fd9e9aff7812a0e899b2098..04143c4ed2127249d11b9fbfed66801c3983a652 100644 (file)
@@ -5153,6 +5153,33 @@ def test_ap_wpa2_eap_too_many_roundtrips(dev, apdev):
     if ev is None or "EAP: more than" not in ev:
         raise Exception("EAP roundtrip limit not reached")
 
+def test_ap_wpa2_eap_too_many_roundtrips_server(dev, apdev):
+    """WPA2-Enterprise connection resulting in too many EAP roundtrips (server)"""
+    run_ap_wpa2_eap_too_many_roundtrips_server(dev, apdev, 10, 10)
+
+def test_ap_wpa2_eap_too_many_roundtrips_server2(dev, apdev):
+    """WPA2-Enterprise connection resulting in too many EAP roundtrips (server)"""
+    run_ap_wpa2_eap_too_many_roundtrips_server(dev, apdev, 10, 1)
+
+def run_ap_wpa2_eap_too_many_roundtrips_server(dev, apdev, max_rounds,
+                                               max_rounds_short):
+    skip_with_fips(dev[0])
+    params = int_eap_server_params()
+    params["max_auth_rounds"] = str(max_rounds)
+    params["max_auth_rounds_short"] = str(max_rounds_short)
+    hostapd.add_ap(apdev[0], params)
+    dev[0].connect("test-wpa2-eap", key_mgmt="WPA-EAP WPA-EAP-SHA256",
+                   eap="TTLS", identity="mschap user",
+                   wait_connect=False, scan_freq="2412", ieee80211w="1",
+                   anonymous_identity="ttls", password="password",
+                   ca_cert="auth_serv/ca.pem", phase2="auth=MSCHAP",
+                   fragment_size="4")
+    ev = dev[0].wait_event(["CTRL-EVENT-EAP-FAILURE",
+                            "CTRL-EVENT-EAP-SUCCESS"], timeout=10)
+    dev[0].request("DISCONNECT")
+    if ev is None or "SUCCESS" in ev:
+        raise Exception("EAP roundtrip limit not reported")
+
 def test_ap_wpa2_eap_expanded_nak(dev, apdev):
     """WPA2-Enterprise connection with EAP resulting in expanded NAK"""
     params = hostapd.wpa2_eap_params(ssid="test-wpa2-eap")