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

This commit is contained in:
Sarvesh Bodakhe
2025-04-06 15:21:54 +05:30
parent cb24473016
commit f8b1c0976a
6 changed files with 25 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2019-2024 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2019-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -43,6 +43,7 @@
#if CONFIG_ESP_WIFI_ENABLE_ROAMING_APP
#include "esp_roaming.h"
#endif
#include "rsn_supp/pmksa_cache.h"
#ifdef CONFIG_DPP
#include "common/dpp.h"
@@ -446,6 +447,12 @@ fail:
}
#endif
static void wpa_config_reload(void)
{
struct wpa_sm *sm = &gWpaSm;
wpa_sm_pmksa_cache_flush(sm, NULL);
}
int esp_supplicant_init(void)
{
int ret = ESP_OK;
@@ -483,6 +490,7 @@ int esp_supplicant_init(void)
wpa_cb->wpa_michael_mic_failure = wpa_michael_mic_failure;
wpa_cb->wpa_config_done = wpa_config_done;
wpa_cb->wpa_sta_clear_curr_pmksa = wpa_sta_clear_curr_pmksa;
wpa_cb->wpa_config_reload = wpa_config_reload;
esp_wifi_register_wpa3_ap_cb(wpa_cb);
esp_wifi_register_wpa3_cb(wpa_cb);