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

Co-authored-by: yinqingzhao <yinqingzhao@espressif.com>
This commit is contained in:
Sarvesh Bodakhe
2025-04-19 16:39:56 +05:30
co-authored by yinqingzhao
parent e63d13e0bd
commit 04a0e6304b
6 changed files with 25 additions and 9 deletions
@@ -333,7 +333,7 @@ typedef enum {
* @brief Structure describing parameters for a Wi-Fi fast scan
*/
typedef struct {
int8_t rssi; /**< The minimum rssi to accept in the fast scan mode */
int8_t rssi; /**< The minimum rssi to accept in the fast scan mode. Defaults to -127 if set to >= 0 */
wifi_auth_mode_t authmode; /**< The weakest auth mode to accept in the fast scan mode
Note: In case this value is not set and password is set as per WPA2 standards(password len >= 8), it will be defaulted to WPA2 and device won't connect to deprecated WEP/WPA networks. Please set auth mode threshold as WIFI_AUTH_WEP/WIFI_AUTH_WPA_PSK to connect to WEP/WPA networks */
} wifi_scan_threshold_t;
@@ -427,7 +427,7 @@ typedef struct {
wifi_scan_method_t scan_method; /**< Do all channel scan or fast scan */
bool bssid_set; /**< Whether set MAC address of target AP or not. Generally, station_config.bssid_set needs to be 0; and it needs to be 1 only when users need to check the MAC address of the AP.*/
uint8_t bssid[6]; /**< MAC address of target AP*/
uint8_t channel; /**< Channel of target AP. Set to 1~13 to scan starting from the specified channel before connecting to AP. If the channel of AP is unknown, set it to 0.*/
uint8_t channel; /**< Channel hint for target AP. Set to 1~13 to scan starting from the specified channel before connecting to AP. Set to 0 for no preference */
uint16_t listen_interval; /**< Listen interval for ESP32 station to receive beacon when WIFI_PS_MAX_MODEM is set. Units: AP beacon intervals. Defaults to 3 if set to 0. */
wifi_sort_method_t sort_method; /**< Sort the connect AP in the list by rssi or security mode */
wifi_scan_threshold_t threshold; /**< When scan_threshold is set, only APs which have an auth mode that is more secure than the selected auth mode and a signal stronger than the minimum RSSI will be used. */