Browse Source

tests: EAP with expanded Nak

Signed-off-by: Jouni Malinen <j@w1.fi>
Jouni Malinen 11 years ago
parent
commit
32dca985c7
1 changed files with 24 additions and 0 deletions
  1. 24 0
      tests/hwsim/test_ap_eap.py

+ 24 - 0
tests/hwsim/test_ap_eap.py

@@ -1198,3 +1198,27 @@ def test_ap_wpa2_eap_too_many_roundtrips(dev, apdev):
     ev = dev[0].wait_event(["EAP: more than"], timeout=20)
     if ev is None:
         raise Exception("EAP roundtrip limit not reached")
+
+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")
+    hostapd.add_ap(apdev[0]['ifname'], params)
+    dev[0].connect("test-wpa2-eap", key_mgmt="WPA-EAP WPA-EAP-SHA256",
+                   eap="PSK", identity="vendor-test",
+                   password_hex="ff23456789abcdef0123456789abcdef",
+                   wait_connect=False)
+
+    found = False
+    for i in range(0, 5):
+        ev = dev[0].wait_event(["CTRL-EVENT-EAP-STATUS"], timeout=10)
+        if ev is None:
+            raise Exception("Association and EAP start timed out")
+        if "refuse proposed method" in ev:
+            found = True
+            break
+    if not found:
+        raise Exception("Unexpected EAP status: " + ev)
+
+    ev = dev[0].wait_event(["CTRL-EVENT-EAP-FAILURE"])
+    if ev is None:
+        raise Exception("EAP failure timed out")