]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: RESEND_M3 and RESEND_GROUP_M1 with PMF in use
authorJouni Malinen <j@w1.fi>
Sun, 1 Apr 2018 18:42:49 +0000 (21:42 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 1 Apr 2018 18:42:49 +0000 (21:42 +0300)
This covers an additional code path that has a bug in IGTK PN clearing.

Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_ap_ciphers.py

index e7921d32a407198b4e970f7c6bf0de0a8e6fccf6..a9e88abe2a8000c1d7a0063e956bbe8f42d0dde6 100644 (file)
@@ -822,6 +822,29 @@ def test_ap_wpa2_plaintext_m1_m3(dev, apdev):
         raise Exception("RESEND_M3 failed")
     time.sleep(0.1)
 
+def test_ap_wpa2_plaintext_m1_m3_pmf(dev, apdev):
+    """Plaintext M1/M3 during PTK rekey (PMF)"""
+    params = hostapd.wpa2_params(ssid="test-wpa2-psk", passphrase="12345678")
+    params["ieee80211w"] = "2"
+    hapd = hostapd.add_ap(apdev[0], params)
+
+    Wlantest.setup(hapd)
+    wt = Wlantest()
+    wt.flush()
+    wt.add_passphrase("12345678")
+
+    dev[0].connect("test-wpa2-psk", psk="12345678", ieee80211w="2",
+                   scan_freq="2412")
+
+    time.sleep(0.1)
+    addr = dev[0].own_addr()
+    if "OK" not in hapd.request("RESEND_M1 " + addr + " plaintext"):
+        raise Exception("RESEND_M1 failed")
+    time.sleep(0.1)
+    if "OK" not in hapd.request("RESEND_M3 " + addr + " plaintext"):
+        raise Exception("RESEND_M3 failed")
+    time.sleep(0.1)
+
 def test_ap_wpa2_plaintext_m3(dev, apdev):
     """Plaintext M3 during PTK rekey"""
     params = hostapd.wpa2_params(ssid="test-wpa2-psk", passphrase="12345678")
@@ -863,3 +886,26 @@ def test_ap_wpa2_plaintext_group_m1(dev, apdev):
     if "OK" not in hapd.request("RESEND_GROUP_M1 " + addr):
         raise Exception("RESEND_GROUP_M1 failed")
     time.sleep(0.1)
+
+def test_ap_wpa2_plaintext_group_m1_pmf(dev, apdev):
+    """Plaintext group M1 (PMF)"""
+    params = hostapd.wpa2_params(ssid="test-wpa2-psk", passphrase="12345678")
+    params["ieee80211w"] = "2"
+    hapd = hostapd.add_ap(apdev[0], params)
+
+    Wlantest.setup(hapd)
+    wt = Wlantest()
+    wt.flush()
+    wt.add_passphrase("12345678")
+
+    dev[0].connect("test-wpa2-psk", psk="12345678", ieee80211w="2",
+                   scan_freq="2412")
+
+    time.sleep(0.1)
+    addr = dev[0].own_addr()
+    if "OK" not in hapd.request("RESEND_GROUP_M1 " + addr + " plaintext"):
+        raise Exception("RESEND_GROUP_M1 failed")
+    time.sleep(0.2)
+    if "OK" not in hapd.request("RESEND_GROUP_M1 " + addr):
+        raise Exception("RESEND_GROUP_M1 failed")
+    time.sleep(0.1)