fix(wifi): Fix wrong PMKSA cache entry being used when wifi password is changed

This commit is contained in:
Sarvesh Bodakhe
2024-07-10 11:29:55 +05:30
committed by Nachiket Kukade
parent 1633c1a2bb
commit 3d5bf355c3
6 changed files with 23 additions and 7 deletions

View File

@@ -2471,7 +2471,7 @@ wpa_set_passphrase(char * passphrase, u8 *ssid, size_t ssid_len)
return;
/* This is really SLOW, so just re cacl while reset param */
if (esp_wifi_sta_get_reset_param_internal() != 0) {
if (esp_wifi_sta_get_reset_nvs_pmk_internal() != 0) {
// check it's psk
if (strlen((char *)esp_wifi_sta_get_prof_password_internal()) == 64) {
if (hexstr2bin((char *)esp_wifi_sta_get_prof_password_internal(),
@@ -2482,7 +2482,7 @@ wpa_set_passphrase(char * passphrase, u8 *ssid, size_t ssid_len)
4096, esp_wifi_sta_get_ap_info_prof_pmk_internal(), PMK_LEN);
}
esp_wifi_sta_update_ap_info_internal();
esp_wifi_sta_set_reset_param_internal(0);
esp_wifi_sta_set_reset_nvs_pmk_internal(0);
}
if (sm->key_mgmt == WPA_KEY_MGMT_IEEE8021X) {
@@ -2994,4 +2994,10 @@ fail:
return -1;
}
#endif // CONFIG_OWE_STA
void wpa_sm_pmksa_cache_flush(struct wpa_sm *sm, void *network_ctx)
{
pmksa_cache_flush(sm->pmksa, network_ctx, NULL, 0);
}
#endif // ESP_SUPPLICANT