From: Veerendranath Jakkam Date: Thu, 16 Feb 2023 16:52:13 +0000 (+0530) Subject: Update PMK in wpa_sm when roam+auth event indicated with authorized flag X-Git-Tag: hostap_2_11~1266 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b2bf7e39ecc9f52e7a0f11a9f8d9e4fc2ce57bd6;p=thirdparty%2Fhostap.git Update PMK in wpa_sm when roam+auth event indicated with authorized flag Currently, the PMK used by the driver is not updated to wpa_sm when roaming is completed by the driver with the cached PMKSA and the roam+auth event is indicated with the authorized flag. To fix this, identify the PMKSA entry from the PMKID sent in Reassociation Request frame and update the correct PMK to wpa_sm from the PMKSA entry. Signed-off-by: Veerendranath Jakkam --- diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c index a9ff49133..8f0ed2033 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -393,7 +393,7 @@ void wpa_supplicant_mark_disassoc(struct wpa_supplicant *wpa_s) } -static void wpa_find_assoc_pmkid(struct wpa_supplicant *wpa_s) +static void wpa_find_assoc_pmkid(struct wpa_supplicant *wpa_s, bool authorized) { struct wpa_ie_data ie; int pmksa_set = -1; @@ -417,6 +417,8 @@ static void wpa_find_assoc_pmkid(struct wpa_supplicant *wpa_s) NULL, NULL, 0, NULL, 0); if (pmksa_set == 0) { eapol_sm_notify_pmkid_attempt(wpa_s->eapol); + if (authorized) + wpa_sm_set_pmk_from_pmksa(wpa_s->wpa); break; } } @@ -3151,7 +3153,8 @@ static int wpa_supplicant_event_associnfo(struct wpa_supplicant *wpa_s, if (wpa_sm_set_assoc_wpa_ie(wpa_s->wpa, p, len)) break; found = 1; - wpa_find_assoc_pmkid(wpa_s); + wpa_find_assoc_pmkid(wpa_s, + data->assoc_info.authorized); } if (!found_x && p[0] == WLAN_EID_RSNX) { if (wpa_sm_set_assoc_rsnxe(wpa_s->wpa, p, len))