]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
PASN: Include PMKID in RSNE in PASN response from AP
authorIlan Peer <ilan.peer@intel.com>
Mon, 15 Mar 2021 12:57:00 +0000 (14:57 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 16 Mar 2021 09:45:12 +0000 (11:45 +0200)
As defined in IEEE P802.11az/D3.0, 12.12.3.2 for the second PASN frame.
This was previously covered only for the case when the explicit PMKSA
was provided to the helper function. Extend that to cover the PMKID from
SAE/FILS authentication cases.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
src/ap/ieee802_11.c

index 2c3832960dce2c6fcc1f7f28acb07fa2ef4ea8b8..66933b200d7645321042fddbfa363013761097c7 100644 (file)
@@ -2887,6 +2887,7 @@ static int handle_auth_pasn_resp(struct hostapd_data *hapd,
        u8 *data_buf = NULL;
        size_t rsn_ie_len, frame_len, data_len;
        int ret;
+       const u8 *pmkid = NULL;
 
        wpa_printf(MSG_DEBUG, "PASN: Building frame 2: status=%u", status);
 
@@ -2900,7 +2901,22 @@ static int handle_auth_pasn_resp(struct hostapd_data *hapd,
        if (status != WLAN_STATUS_SUCCESS)
                goto done;
 
-       if (wpa_pasn_add_rsne(buf, pmksa ? pmksa->pmkid : NULL,
+       if (pmksa) {
+               pmkid = pmksa->pmkid;
+#ifdef CONFIG_SAE
+       } else if (sta->pasn->akmp == WPA_KEY_MGMT_SAE) {
+               wpa_printf(MSG_DEBUG, "PASN: Use SAE PMKID");
+               pmkid = sta->pasn->sae.pmkid;
+#endif /* CONFIG_SAE */
+#ifdef CONFIG_FILS
+       } else if (sta->pasn->akmp == WPA_KEY_MGMT_FILS_SHA256 ||
+                  sta->pasn->akmp == WPA_KEY_MGMT_FILS_SHA384) {
+               wpa_printf(MSG_DEBUG, "PASN: Use FILS ERP PMKID");
+               pmkid = sta->pasn->fils.erp_pmkid;
+#endif /* CONFIG_FILS */
+       }
+
+       if (wpa_pasn_add_rsne(buf, pmkid,
                              sta->pasn->akmp, sta->pasn->cipher) < 0)
                goto fail;