fix(esp_wifi): Flush PMK when EAP config is changed

This commit is contained in:
Kapil Gupta
2025-04-08 12:45:00 +05:30
parent c2fad24731
commit 582c2d8d4c
2 changed files with 51 additions and 12 deletions

View File

@@ -53,6 +53,7 @@
bool g_wpa_pmk_caching_disabled = 0;
const wifi_osi_funcs_t *wifi_funcs;
struct wpa_funcs *wpa_cb;
bool g_wpa_config_changed;
void wpa_install_key(enum wpa_alg alg, u8 *addr, int key_idx, int set_tx,
u8 *seq, size_t seq_len, u8 *key, size_t key_len, enum key_flag key_flag)
@@ -229,11 +230,22 @@ int dpp_connect(uint8_t *bssid, bool pdr_done)
}
#endif
static void wpa_config_reload(void)
{
struct wpa_sm *sm = &gWpaSm;
wpa_sm_pmksa_cache_flush(sm, NULL);
}
int wpa_sta_connect(uint8_t *bssid)
{
/* use this API to set AP specific IEs during connection */
int ret = 0;
ret = wpa_config_profile(bssid);
if (g_wpa_config_changed) {
wpa_config_reload();
g_wpa_config_changed = false;
}
if (ret == 0) {
ret = wpa_config_bss(bssid);
if (ret) {
@@ -447,12 +459,6 @@ 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;