]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P2: Configure PMK/PMKID to the driver on the GO
authorShivani Baranwal <quic_shivbara@quicinc.com>
Sun, 4 Aug 2024 22:12:08 +0000 (03:42 +0530)
committerJouni Malinen <j@w1.fi>
Thu, 31 Oct 2024 19:49:46 +0000 (21:49 +0200)
In P2P2, the PMKSA is generated through the PASN frame exchange during
the pairing process. Once pairing and group negotiation are successful,
the P2P Client initiates a connection with the P2P GO using the PMKID
derived during the pairing process. In the case of AP SME offload to the
driver, the driver handles the Association Request and Response frames
and needs to be able to determine whether the provided PMKID is known.
Therefore, configure the PMKID to the driver on the P2P GO to allow
association with the P2P Client.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
src/ap/ap_drv_ops.c
src/ap/ap_drv_ops.h
wpa_supplicant/p2p_supplicant.c

index dc1f7480c4ed6a68ef3f4de85376e6dd256b0c30..6fa5f2779db65c80ac8829c78fe61bd0a2f59a01 100644 (file)
@@ -1289,3 +1289,27 @@ hostapd_get_multi_hw_info(struct hostapd_data *hapd,
 
        return hapd->driver->get_multi_hw_info(hapd->drv_priv, num_multi_hws);
 }
+
+
+int hostapd_drv_add_pmkid(struct hostapd_data *hapd,
+                         struct wpa_pmkid_params *params)
+{
+       if (!hapd->driver || !hapd->driver->add_pmkid || !hapd->drv_priv)
+               return 0;
+       return hapd->driver->add_pmkid(hapd->drv_priv, params);
+}
+
+
+int hostapd_add_pmkid(struct hostapd_data *hapd, const u8 *bssid, const u8 *pmk,
+                     size_t pmk_len, const u8 *pmkid, int akmp)
+{
+       struct wpa_pmkid_params params;
+
+       os_memset(&params, 0, sizeof(params));
+       params.bssid = bssid;
+       params.pmkid = pmkid;
+       params.pmk = pmk;
+       params.pmk_len = pmk_len;
+
+       return hostapd_drv_add_pmkid(hapd, &params);
+}
index 34f7fb77ce53e1bd1a3a6b83f5f9e66f281646ff..7b55253475a110d96f051bc50a6d216c3162d090 100644 (file)
@@ -487,4 +487,9 @@ struct hostapd_multi_hw_info *
 hostapd_get_multi_hw_info(struct hostapd_data *hapd,
                          unsigned int *num_multi_hws);
 
+int hostapd_drv_add_pmkid(struct hostapd_data *hapd,
+                         struct wpa_pmkid_params *params);
+int hostapd_add_pmkid(struct hostapd_data *hapd, const u8 *bssid, const u8 *pmk,
+                     size_t pmk_len, const u8 *pmkid, int akmp);;
+
 #endif /* AP_DRV_OPS */
index 0f3512d6f92396e1e9fb77586fb6c0ca48cbb778..60223926d4d3cc69e85020f9fca82c409174fd9a 100644 (file)
@@ -2092,6 +2092,9 @@ static void p2p_go_configured(void *ctx, void *data)
                                       params->peer_device_addr,
                                       params->pmk, params->pmk_len,
                                       params->pmkid, WPA_KEY_MGMT_SAE);
+               hostapd_add_pmkid(hapd, params->peer_device_addr,
+                                 params->pmk, params->pmk_len,
+                                 params->pmkid, WPA_KEY_MGMT_SAE);
        }
 
        p2p_go_save_group_common_freqs(wpa_s, params);
@@ -2733,6 +2736,9 @@ static void wpas_set_go_security_config(void *ctx,
                                       params->peer_device_addr,
                                       params->pmk, params->pmk_len,
                                       params->pmkid, WPA_KEY_MGMT_SAE);
+               hostapd_add_pmkid(hapd, params->peer_device_addr,
+                                 params->pmk, params->pmk_len,
+                                 params->pmkid, WPA_KEY_MGMT_SAE);
        }
 }