From: Ilan Peer Date: Mon, 15 Mar 2021 12:57:00 +0000 (+0200) Subject: PASN: Include PMKID in RSNE in PASN response from AP X-Git-Tag: hostap_2_10~394 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cd0813763add7a7d2905c059a2649d08413b4a81;p=thirdparty%2Fhostap.git 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 --- 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;