From d97c8ed1b10c7ecfbb94efda4b4650d670e53ecf Mon Sep 17 00:00:00 2001 From: Sarvesh Bodakhe Date: Tue, 2 Apr 2024 02:01:33 +0530 Subject: [PATCH] fix(wifi): Add bugfix to avoid RSNXE and KDE mismatch during 4-way-handshake --- components/wpa_supplicant/esp_supplicant/src/esp_wpa_main.c | 1 + components/wpa_supplicant/src/rsn_supp/wpa.c | 1 + 2 files changed, 2 insertions(+) diff --git a/components/wpa_supplicant/esp_supplicant/src/esp_wpa_main.c b/components/wpa_supplicant/esp_supplicant/src/esp_wpa_main.c index 6150838fa4..32f8efec0e 100644 --- a/components/wpa_supplicant/esp_supplicant/src/esp_wpa_main.c +++ b/components/wpa_supplicant/esp_supplicant/src/esp_wpa_main.c @@ -368,6 +368,7 @@ static bool hostap_sta_join(void **sta, u8 *bssid, u8 *wpa_ie, u8 wpa_ie_len, u8 #endif /* CONFIG_SAE */ if (!esp_wifi_ap_is_sta_sae_reauth_node(bssid)) { ap_free_sta(hapd, old_sta); + *sta = NULL; } #ifdef CONFIG_SAE else if (old_sta && old_sta->lock) { diff --git a/components/wpa_supplicant/src/rsn_supp/wpa.c b/components/wpa_supplicant/src/rsn_supp/wpa.c index 298d414c9f..df5448077d 100644 --- a/components/wpa_supplicant/src/rsn_supp/wpa.c +++ b/components/wpa_supplicant/src/rsn_supp/wpa.c @@ -2348,6 +2348,7 @@ int wpa_set_bss(char *macddr, char * bssid, u8 pairwise_cipher, u8 group_cipher, sm->ap_notify_completed_rsne = esp_wifi_sta_is_ap_notify_completed_rsne_internal(); sm->use_ext_key_id = (sm->proto == WPA_PROTO_WPA); pmksa_cache_clear_current(sm); + sm->sae_pwe = esp_wifi_get_config_sae_pwe_h2e_internal(WIFI_IF_STA); struct rsn_pmksa_cache_entry *pmksa = NULL; if (use_pmk_cache) {