]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Update PMK in wpa_sm when roam+auth event indicated with authorized flag
authorVeerendranath Jakkam <quic_vjakkam@quicinc.com>
Thu, 16 Feb 2023 16:52:13 +0000 (22:22 +0530)
committerJouni Malinen <j@w1.fi>
Thu, 23 Feb 2023 11:16:52 +0000 (13:16 +0200)
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>
wpa_supplicant/events.c

index a9ff491330bea08cabd48a1285289b78d80d102e..8f0ed2033da4fc27d76e60e8e2cc3ba3f5586b78 100644 (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))