From 0016d209468cca2ba9796e4afe8092c9939ed6e5 Mon Sep 17 00:00:00 2001 From: Nachiket Kukade Date: Wed, 30 Sep 2020 12:06:04 +0530 Subject: [PATCH] esp_wifi: Update wifi lib 1. Add STA checks during STA PMF operations 2. Fix WPA2-Ent issue with Open AP 3. Skip WPA-TKIP profile if PMF is required 4. Skip & clear Supplicant PMK Cache for mismatching AP config --- components/esp_wifi/lib_esp32 | 2 +- .../src/esp_supplicant/esp_wifi_driver.h | 1 + components/wpa_supplicant/src/rsn_supp/wpa.c | 15 +++++++++++++-- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/components/esp_wifi/lib_esp32 b/components/esp_wifi/lib_esp32 index 4bfb6b161d..f860ff7f88 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 b8667c5132..4415f200a8 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 8b04126dee..00297d5b0b 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