From cd0813763add7a7d2905c059a2649d08413b4a81 Mon Sep 17 00:00:00 2001 From: Ilan Peer Date: Mon, 15 Mar 2021 14:57:00 +0200 Subject: [PATCH] PASN: Include PMKID in RSNE in PASN response from AP 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 --- src/ap/ieee802_11.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c index 2c3832960..66933b200 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c @@ -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;