diff --git a/components/esp_wifi/lib_esp32 b/components/esp_wifi/lib_esp32 index 4bfb6b161..f860ff7f8 160000 --- a/components/esp_wifi/lib_esp32 +++ b/components/esp_wifi/lib_esp32 @@ -1 +1 @@ -Subproject commit 4bfb6b161dc0cf43187ddb3096efdc7de81fa911 +Subproject commit f860ff7f8897d0ffd8a939ef2b3d1c8bc4508ef6 diff --git a/components/wpa_supplicant/src/esp_supplicant/esp_wifi_driver.h b/components/wpa_supplicant/src/esp_supplicant/esp_wifi_driver.h index b8667c513..4415f200a 100644 --- a/components/wpa_supplicant/src/esp_supplicant/esp_wifi_driver.h +++ b/components/wpa_supplicant/src/esp_supplicant/esp_wifi_driver.h @@ -234,5 +234,6 @@ esp_err_t esp_wifi_set_wps_start_flag_internal(bool start); uint16_t esp_wifi_sta_pmf_enabled(void); wifi_cipher_type_t esp_wifi_sta_get_mgmt_group_cipher(void); int esp_wifi_set_igtk_internal(uint8_t if_index, const wifi_wpa_igtk_t *igtk); +bool esp_wifi_skip_supp_pmkcaching(void); #endif /* _ESP_WIFI_DRIVER_H_ */ diff --git a/components/wpa_supplicant/src/rsn_supp/wpa.c b/components/wpa_supplicant/src/rsn_supp/wpa.c index 8b04126de..00297d5b0 100644 --- a/components/wpa_supplicant/src/rsn_supp/wpa.c +++ b/components/wpa_supplicant/src/rsn_supp/wpa.c @@ -2119,8 +2119,19 @@ int wpa_set_bss(char *macddr, char * bssid, u8 pairwise_cipher, u8 group_cipher, if (sm->key_mgmt == WPA_KEY_MGMT_SAE || (esp_wifi_sta_prof_is_wpa2_internal() && esp_wifi_sta_get_prof_authmode_internal() == WPA2_AUTH_ENT)) { - pmksa_cache_set_current(sm, NULL, (const u8*) bssid, 0, 0); - wpa_sm_set_pmk_from_pmksa(sm); + if (!esp_wifi_skip_supp_pmkcaching()) { + pmksa_cache_set_current(sm, NULL, (const u8*) bssid, 0, 0); + wpa_sm_set_pmk_from_pmksa(sm); + } else { + struct rsn_pmksa_cache_entry *entry = NULL; + + if (sm->pmksa) { + entry = pmksa_cache_get(sm->pmksa, (const u8 *)bssid, NULL, NULL); + } + if (entry) { + pmksa_cache_flush(sm->pmksa, NULL, entry->pmk, entry->pmk_len); + } + } } #ifdef CONFIG_IEEE80211W