From cc1867f5caaffd43c544ce841f6f8aa3cca744be Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Mon, 6 Nov 2023 20:01:14 +0200 Subject: [PATCH] MLD STA: Use MLD MAC address as destination for EAPOL-Key request Also this EAPOL frame uses the MLD MAC address of the AP MLD when sent during an MLO association. Signed-off-by: Jouni Malinen --- src/rsn_supp/wpa.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/rsn_supp/wpa.c b/src/rsn_supp/wpa.c index de1525501..b3bc2bbed 100644 --- a/src/rsn_supp/wpa.c +++ b/src/rsn_supp/wpa.c @@ -222,7 +222,7 @@ void wpa_sm_key_request(struct wpa_sm *sm, int error, int pairwise) size_t mic_len, hdrlen, rlen; struct wpa_eapol_key *reply; int key_info, ver; - u8 bssid[ETH_ALEN], *rbuf, *key_mic, *mic; + u8 *rbuf, *key_mic, *mic; if (pairwise && sm->wpa_deny_ptk0_rekey && !sm->use_ext_key_id && wpa_sm_get_state(sm) == WPA_COMPLETED && !error) { @@ -242,12 +242,6 @@ void wpa_sm_key_request(struct wpa_sm *sm, int error, int pairwise) else ver = WPA_KEY_INFO_TYPE_HMAC_MD5_RC4; - if (wpa_sm_get_bssid(sm, bssid) < 0) { - wpa_msg(sm->ctx->msg_ctx, MSG_WARNING, - "Failed to read BSSID for EAPOL-Key request"); - return; - } - mic_len = wpa_mic_len(sm->key_mgmt, sm->pmk_len); hdrlen = sizeof(*reply) + mic_len + 2; rbuf = wpa_sm_alloc_eapol(sm, IEEE802_1X_TYPE_EAPOL_KEY, NULL, @@ -284,8 +278,8 @@ void wpa_sm_key_request(struct wpa_sm *sm, int error, int pairwise) "WPA: Sending EAPOL-Key Request (error=%d " "pairwise=%d ptk_set=%d len=%lu)", error, pairwise, sm->ptk_set, (unsigned long) rlen); - wpa_eapol_key_send(sm, &sm->ptk, ver, bssid, ETH_P_EAPOL, rbuf, rlen, - key_mic); + wpa_eapol_key_send(sm, &sm->ptk, ver, wpa_sm_get_auth_addr(sm), + ETH_P_EAPOL, rbuf, rlen, key_mic); }