]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: FT-EAP and PMKSA caching for initial mobility domain association
authorJouni Malinen <jouni@codeaurora.org>
Sun, 28 Apr 2019 13:03:03 +0000 (16:03 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 28 Apr 2019 13:07:22 +0000 (16:07 +0300)
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
tests/hwsim/test_ap_ft.py
tests/hwsim/wpasupplicant.py

index b42330736d57d54d2c96f939c151ce6b55d975a2..6c780efe3a822c55dddc69eb5dc737c59a93046c 100644 (file)
@@ -149,6 +149,8 @@ def run_roams(dev, apdev, hapd0, hapd1, ssid, passphrase, over_ds=False,
     if ocv:
         copts["ocv"] = ocv
     if eap:
+        if pmksa_caching:
+            copts["ft_eap_pmksa_caching"] = "1"
         if also_non_ft:
             copts["key_mgmt"] = "WPA-EAP-SUITE-B-192 FT-EAP-SHA384" if sha384 else "WPA-EAP FT-EAP"
         else:
@@ -174,12 +176,16 @@ def run_roams(dev, apdev, hapd0, hapd1, ssid, passphrase, over_ds=False,
         dev.request("DISCONNECT")
         dev.wait_disconnected()
         dev.request("RECONNECT")
-        ev = dev.wait_event(["CTRL-EVENT-CONNECTED", "CTRL-EVENT-DISCONNECTED"],
+        ev = dev.wait_event(["CTRL-EVENT-CONNECTED",
+                             "CTRL-EVENT-DISCONNECTED",
+                             "CTRL-EVENT-EAP-STARTED"],
                             timeout=15)
         if ev is None:
             raise Exception("Reconnect timed out")
         if "CTRL-EVENT-DISCONNECTED" in ev:
             raise Exception("Unexpected disconnection after RECONNECT")
+        if "CTRL-EVENT-EAP-STARTED" in ev:
+            raise Exception("Unexpected EAP start after RECONNECT")
 
     if dev.get_status_field('bssid') == apdev[0]['bssid']:
         ap1 = apdev[0]
@@ -2845,3 +2851,49 @@ def test_ap_ft_roam_rrm(dev, apdev):
     dev[0].scan_for_bss(bssid0, freq=2412)
     dev[0].roam(bssid0)
     check_beacon_req(hapd0, addr, 3)
+
+def test_ap_ft_pmksa_caching(dev, apdev):
+    """FT-EAP and PMKSA caching for initial mobility domain association"""
+    ssid = "test-ft"
+    identity = "gpsk user"
+
+    radius = hostapd.radius_params()
+    params = ft_params1(ssid=ssid)
+    params['wpa_key_mgmt'] = "FT-EAP"
+    params["ieee8021x"] = "1"
+    params["mobility_domain"] = "c3d4"
+    params = dict(list(radius.items()) + list(params.items()))
+    hapd = hostapd.add_ap(apdev[0], params)
+
+    params = ft_params2(ssid=ssid)
+    params['wpa_key_mgmt'] = "FT-EAP"
+    params["ieee8021x"] = "1"
+    params["mobility_domain"] = "c3d4"
+    params = dict(list(radius.items()) + list(params.items()))
+    hapd1 = hostapd.add_ap(apdev[1], params)
+
+    run_roams(dev[0], apdev, hapd, hapd1, ssid, None, eap=True,
+              eap_identity=identity, pmksa_caching=True)
+
+def test_ap_ft_pmksa_caching_sha384(dev, apdev):
+    """FT-EAP-SHA384 and PMKSA caching for initial mobility domain association"""
+    ssid = "test-ft"
+    identity = "gpsk user"
+
+    radius = hostapd.radius_params()
+    params = ft_params1(ssid=ssid)
+    params['wpa_key_mgmt'] = "FT-EAP-SHA384"
+    params["ieee8021x"] = "1"
+    params["mobility_domain"] = "c3d4"
+    params = dict(list(radius.items()) + list(params.items()))
+    hapd = hostapd.add_ap(apdev[0], params)
+
+    params = ft_params2(ssid=ssid)
+    params['wpa_key_mgmt'] = "FT-EAP-SHA384"
+    params["ieee8021x"] = "1"
+    params["mobility_domain"] = "c3d4"
+    params = dict(list(radius.items()) + list(params.items()))
+    hapd1 = hostapd.add_ap(apdev[1], params)
+
+    run_roams(dev[0], apdev, hapd, hapd1, ssid, None, eap=True,
+              eap_identity=identity, pmksa_caching=True, sha384=True)
index 1543600aa7d54e93b594cad2770dc7814f46b4b7..be1963704ba091ea44cd8469a5d8f6c70fde39b1 100644 (file)
@@ -1084,7 +1084,8 @@ class WpaSupplicant:
                       "dpp_netaccesskey", "dpp_netaccesskey_expiry",
                       "group_mgmt", "owe_group",
                       "roaming_consortium_selection", "ocv",
-                      "multi_ap_backhaul_sta", "rx_stbc", "tx_stbc"]
+                      "multi_ap_backhaul_sta", "rx_stbc", "tx_stbc",
+                      "ft_eap_pmksa_caching"]
         for field in not_quoted:
             if field in kwargs and kwargs[field]:
                 self.set_network(id, field, kwargs[field])