tests: Hotspot 2.0 connection and deauthentication request without PMF
authorJouni Malinen <j@w1.fi>
Tue, 12 Jul 2016 17:49:02 +0000 (20:49 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 12 Jul 2016 17:49:02 +0000 (20:49 +0300)
Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_ap_hs20.py

index e26274a..93e9ae9 100644 (file)
@@ -2434,6 +2434,19 @@ def _test_ap_hs20_deauth_req_from_radius(dev, apdev):
         raise Exception("Unexpected deauth imminent contents")
     dev[0].wait_disconnected(timeout=3)
 
+def test_ap_hs20_deauth_req_without_pmf(dev, apdev):
+    """Hotspot 2.0 connection and deauthentication request without PMF"""
+    check_eap_capa(dev[0], "MSCHAPV2")
+    dev[0].request("SET pmf 0")
+    eap_test(dev[0], apdev[0], "21[3:26]", "TTLS", "user")
+    dev[0].dump_monitor()
+    addr = dev[0].own_addr()
+    hapd = hostapd.Hostapd(apdev[0]['ifname'])
+    hapd.request("HS20_DEAUTH_REQ " + addr + " 1 120 http://example.com/")
+    ev = dev[0].wait_event(["HS20-DEAUTH-IMMINENT-NOTICE"], timeout=0.2)
+    if ev is not None:
+        raise Exception("Deauth imminent notice without PMF accepted")
+
 def test_ap_hs20_remediation_required(dev, apdev):
     """Hotspot 2.0 connection and remediation required from RADIUS"""
     check_eap_capa(dev[0], "MSCHAPV2")