diff --git a/src/rsn_supp/wpa.c b/src/rsn_supp/wpa.c index 8aa649ac4..0a2f87787 100644 --- a/src/rsn_supp/wpa.c +++ b/src/rsn_supp/wpa.c @@ -3132,9 +3132,11 @@ void wpa_sm_set_pmk(struct wpa_sm *sm, const u8 *pmk, size_t pmk_len, #endif /* CONFIG_IEEE80211R */ if (bssid) { - pmksa_cache_add(sm->pmksa, pmk, pmk_len, pmkid, NULL, 0, - bssid, sm->own_addr, - sm->network_ctx, sm->key_mgmt, NULL); + sm->cur_pmksa = pmksa_cache_add(sm->pmksa, pmk, pmk_len, + pmkid, NULL, 0, bssid, + sm->own_addr, + sm->network_ctx, sm->key_mgmt, + NULL); } } diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c index 7b892dac2..6fe3426d0 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -356,9 +356,14 @@ static void wpa_find_assoc_pmkid(struct wpa_supplicant *wpa_s) struct wpa_ie_data ie; int pmksa_set = -1; size_t i; + struct rsn_pmksa_cache_entry *cur_pmksa; - /* Start with assumption of no PMKSA cache entry match */ - pmksa_cache_clear_current(wpa_s->wpa); + /* Start with assumption of no PMKSA cache entry match for cases other + * than SAE. In particular, this is needed to generate the PMKSA cache + * entries for Suite B cases with driver-based roaming indication. */ + cur_pmksa = pmksa_cache_get_current(wpa_s->wpa); + if (cur_pmksa && !wpa_key_mgmt_sae(cur_pmksa->akmp)) + pmksa_cache_clear_current(wpa_s->wpa); if (wpa_sm_parse_own_wpa_ie(wpa_s->wpa, &ie) < 0 || ie.pmkid == NULL)