]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Suite B and PMKSA caching multiple times
authorJouni Malinen <jouni@codeaurora.org>
Thu, 27 Sep 2018 08:43:58 +0000 (11:43 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 27 Sep 2018 08:43:58 +0000 (11:43 +0300)
This verifies that wpa_supplicant and hostapd behave consistently with
PMKSA caching when Suite B AKMs end up deriving a new PMKID from each
4-way handshake.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
tests/hwsim/test_suite_b.py

index db2cac7e0e70bccde980a21eb91a81f6b4580735..762e7e3f279b8deb5b973f3f9abb0380c85eebe7 100644 (file)
@@ -94,6 +94,17 @@ def test_suite_b(dev, apdev):
     if conf['key_mgmt'] != 'WPA-EAP-SUITE-B':
         raise Exception("Unexpected config key_mgmt: " + conf['key_mgmt'])
 
+    dev[0].request("DISCONNECT")
+    dev[0].wait_disconnected(timeout=20)
+    dev[0].dump_monitor()
+    dev[0].request("RECONNECT")
+    ev = dev[0].wait_event(["CTRL-EVENT-EAP-STARTED",
+                            "CTRL-EVENT-CONNECTED"], timeout=20)
+    if ev is None:
+        raise Exception("Roaming with the AP timed out (2)")
+    if "CTRL-EVENT-EAP-STARTED" in ev:
+        raise Exception("Unexpected EAP exchange (2)")
+
 def suite_b_as_params():
     params = {}
     params['ssid'] = 'as'
@@ -205,6 +216,17 @@ def test_suite_b_192(dev, apdev):
     if conf['key_mgmt'] != 'WPA-EAP-SUITE-B-192':
         raise Exception("Unexpected config key_mgmt: " + conf['key_mgmt'])
 
+    dev[0].request("DISCONNECT")
+    dev[0].wait_disconnected(timeout=20)
+    dev[0].dump_monitor()
+    dev[0].request("RECONNECT")
+    ev = dev[0].wait_event(["CTRL-EVENT-EAP-STARTED",
+                            "CTRL-EVENT-CONNECTED"], timeout=20)
+    if ev is None:
+        raise Exception("Roaming with the AP timed out (2)")
+    if "CTRL-EVENT-EAP-STARTED" in ev:
+        raise Exception("Unexpected EAP exchange (2)")
+
 def test_suite_b_192_radius(dev, apdev):
     """WPA2/GCMP-256 (RADIUS) connection at Suite B 192-bit level"""
     check_suite_b_192_capa(dev)