Skip to content

Commit

Permalink
esp_wifi: Flush PMK caching if bss akm has changed
Browse files Browse the repository at this point in the history
  • Loading branch information
kapilkedawat committed Dec 16, 2022
1 parent 5278cc7 commit 39ed5dc
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions components/wpa_supplicant/src/rsn_supp/wpa.c
Original file line number Diff line number Diff line change
Expand Up @@ -2331,8 +2331,15 @@ int wpa_set_bss(char *macddr, char * bssid, u8 pairwise_cipher, u8 group_cipher,
sm->key_mgmt == WPA_KEY_MGMT_OWE ||
is_wpa2_enterprise_connection()) {
if (!esp_wifi_skip_supp_pmkcaching() && use_pmk_cache) {
pmksa_cache_set_current(sm, NULL, (const u8*) bssid, 0, 0);
wpa_sm_set_pmk_from_pmksa(sm);
if (pmksa_cache_set_current(sm, NULL, (const u8*) bssid, 0, 0) == 0) {
struct rsn_pmksa_cache_entry *pmksa = pmksa_cache_get_current(sm);
if (pmksa && (pmksa->akmp != sm->key_mgmt)) {
pmksa_cache_clear_current(sm);
pmksa_cache_flush(sm->pmksa, NULL, pmksa->pmk, pmksa->pmk_len);
}
} else {
wpa_sm_set_pmk_from_pmksa(sm);
}
} else {
struct rsn_pmksa_cache_entry *entry = NULL;

Expand Down

0 comments on commit 39ed5dc

Please sign in to comment.