]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Clear current PMKSA cache selection on association/roam
authorJouni Malinen <jouni@codeaurora.org>
Mon, 25 May 2020 13:25:50 +0000 (16:25 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 25 May 2020 13:25:50 +0000 (16:25 +0300)
It was possible for the RSN state machine to maintain old PMKSA cache
selection (sm->cur_pmksa) when roaming to another BSS based on
driver-based roaming indication. This could result in mismatching state
and unexpected behavior, e.g., with not generating a Suite B PMKSA cache
entry.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
src/rsn_supp/pmksa_cache.c
wpa_supplicant/events.c

index bd32cef08358862bfa98aea2644afea23a726dd7..4a175f166e7222226264c6a05e5c5416703a089d 100644 (file)
@@ -485,6 +485,9 @@ void pmksa_cache_clear_current(struct wpa_sm *sm)
 {
        if (sm == NULL)
                return;
+       if (sm->cur_pmksa)
+               wpa_printf(MSG_DEBUG,
+                          "RSN: Clear current PMKSA entry selection");
        sm->cur_pmksa = NULL;
 }
 
index 46341e93650d217f832f488840a90c04c9b3e648..f0f91892f0a2598a020fa8289c7eb087819154ee 100644 (file)
@@ -356,6 +356,9 @@ static void wpa_find_assoc_pmkid(struct wpa_supplicant *wpa_s)
        int pmksa_set = -1;
        size_t i;
 
+       /* Start with assumption of no PMKSA cache entry match */
+       pmksa_cache_clear_current(wpa_s->wpa);
+
        if (wpa_sm_parse_own_wpa_ie(wpa_s->wpa, &ie) < 0 ||
            ie.pmkid == NULL)
                return;