Clear current PMKSA cache selection on association/roam

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>
This commit is contained in:
Jouni Malinen 2020-05-25 16:25:50 +03:00 committed by Jouni Malinen
parent bf47f0542f
commit c2080e8657
2 changed files with 6 additions and 0 deletions

View file

@ -485,6 +485,9 @@ void pmksa_cache_clear_current(struct wpa_sm *sm)
{ {
if (sm == NULL) if (sm == NULL)
return; return;
if (sm->cur_pmksa)
wpa_printf(MSG_DEBUG,
"RSN: Clear current PMKSA entry selection");
sm->cur_pmksa = NULL; sm->cur_pmksa = NULL;
} }

View file

@ -356,6 +356,9 @@ static void wpa_find_assoc_pmkid(struct wpa_supplicant *wpa_s)
int pmksa_set = -1; int pmksa_set = -1;
size_t i; 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 || if (wpa_sm_parse_own_wpa_ie(wpa_s->wpa, &ie) < 0 ||
ie.pmkid == NULL) ie.pmkid == NULL)
return; return;