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 <quic_vjakkam@quicinc.com>
This commit is contained in:
Veerendranath Jakkam 2023-02-16 22:22:13 +05:30 committed by Jouni Malinen
parent 6b9c86466c
commit b2bf7e39ec

View file

@ -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))