mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-30 18:57:19 +02:00
bugfix(wifi): Fix incorrect SAE-PK advertisement in assoc request
This commit is contained in:
@ -295,6 +295,8 @@ static void wpa_sta_connected_cb(uint8_t *bssid)
|
|||||||
|
|
||||||
static void wpa_sta_disconnected_cb(uint8_t reason_code)
|
static void wpa_sta_disconnected_cb(uint8_t reason_code)
|
||||||
{
|
{
|
||||||
|
struct wpa_sm *sm = &gWpaSm;
|
||||||
|
|
||||||
switch (reason_code) {
|
switch (reason_code) {
|
||||||
case WIFI_REASON_AUTH_EXPIRE:
|
case WIFI_REASON_AUTH_EXPIRE:
|
||||||
case WIFI_REASON_CLASS2_FRAME_FROM_NONAUTH_STA:
|
case WIFI_REASON_CLASS2_FRAME_FROM_NONAUTH_STA:
|
||||||
@ -308,7 +310,7 @@ static void wpa_sta_disconnected_cb(uint8_t reason_code)
|
|||||||
case WIFI_REASON_INVALID_MDE:
|
case WIFI_REASON_INVALID_MDE:
|
||||||
case WIFI_REASON_INVALID_FTE:
|
case WIFI_REASON_INVALID_FTE:
|
||||||
wpa_sta_clear_curr_pmksa();
|
wpa_sta_clear_curr_pmksa();
|
||||||
wpa_sm_notify_disassoc(&gWpaSm);
|
wpa_sm_notify_disassoc(sm);
|
||||||
#if defined(CONFIG_IEEE80211R)
|
#if defined(CONFIG_IEEE80211R)
|
||||||
/* clear all ft auth related IEs so that next will be open auth */
|
/* clear all ft auth related IEs so that next will be open auth */
|
||||||
wpa_sta_clear_ft_auth_ie();
|
wpa_sta_clear_ft_auth_ie();
|
||||||
@ -321,6 +323,13 @@ static void wpa_sta_disconnected_cb(uint8_t reason_code)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sm->rx_replay_counter_set = 0; //init state not intall replay counter value
|
||||||
|
memset(sm->rx_replay_counter, 0, WPA_REPLAY_COUNTER_LEN);
|
||||||
|
sm->wpa_ptk_rekey = 0;
|
||||||
|
pmksa_cache_clear_current(sm);
|
||||||
|
sm->sae_pk = false;
|
||||||
|
sm->eapol1_count = 0;
|
||||||
|
|
||||||
struct wps_sm_funcs *wps_sm_cb = wps_get_wps_sm_cb();
|
struct wps_sm_funcs *wps_sm_cb = wps_get_wps_sm_cb();
|
||||||
if (wps_sm_cb && wps_sm_cb->wps_sm_notify_deauth) {
|
if (wps_sm_cb && wps_sm_cb->wps_sm_notify_deauth) {
|
||||||
wps_sm_cb->wps_sm_notify_deauth();
|
wps_sm_cb->wps_sm_notify_deauth();
|
||||||
|
@ -2340,15 +2340,11 @@ int wpa_set_bss(char *macddr, char * bssid, u8 pairwise_cipher, u8 group_cipher,
|
|||||||
|
|
||||||
sm->pairwise_cipher = BIT(pairwise_cipher);
|
sm->pairwise_cipher = BIT(pairwise_cipher);
|
||||||
sm->group_cipher = BIT(group_cipher);
|
sm->group_cipher = BIT(group_cipher);
|
||||||
sm->rx_replay_counter_set = 0; //init state not intall replay counter value
|
|
||||||
memset(sm->rx_replay_counter, 0, WPA_REPLAY_COUNTER_LEN);
|
|
||||||
sm->wpa_ptk_rekey = 0;
|
|
||||||
sm->renew_snonce = 1;
|
sm->renew_snonce = 1;
|
||||||
memcpy(sm->own_addr, macddr, ETH_ALEN);
|
memcpy(sm->own_addr, macddr, ETH_ALEN);
|
||||||
memcpy(sm->bssid, bssid, ETH_ALEN);
|
memcpy(sm->bssid, bssid, ETH_ALEN);
|
||||||
sm->ap_notify_completed_rsne = esp_wifi_sta_is_ap_notify_completed_rsne_internal();
|
sm->ap_notify_completed_rsne = esp_wifi_sta_is_ap_notify_completed_rsne_internal();
|
||||||
sm->use_ext_key_id = (sm->proto == WPA_PROTO_WPA);
|
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);
|
sm->sae_pwe = esp_wifi_get_config_sae_pwe_h2e_internal(WIFI_IF_STA);
|
||||||
|
|
||||||
struct rsn_pmksa_cache_entry *pmksa = NULL;
|
struct rsn_pmksa_cache_entry *pmksa = NULL;
|
||||||
@ -2371,7 +2367,6 @@ int wpa_set_bss(char *macddr, char * bssid, u8 pairwise_cipher, u8 group_cipher,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sm->eapol1_count = 0;
|
|
||||||
#ifdef CONFIG_IEEE80211W
|
#ifdef CONFIG_IEEE80211W
|
||||||
if (esp_wifi_sta_pmf_enabled()) {
|
if (esp_wifi_sta_pmf_enabled()) {
|
||||||
wifi_config_t wifi_cfg;
|
wifi_config_t wifi_cfg;
|
||||||
|
Reference in New Issue
Block a user