Skip to content

Commit c707faa

Browse files
Merge branch 'bugfix/incorrect_sae_pk_flag' into 'master'
Disable SAE-PK indication in Assoc Request when not configured Closes WIFIBUG-1044 See merge request espressif/esp-idf!38320
2 parents 4983ba1 + 1b9fe21 commit c707faa

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

components/wpa_supplicant/esp_supplicant/src/esp_wpa_main.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,8 @@ static void wpa_sta_connected_cb(uint8_t *bssid)
295295

296296
static void wpa_sta_disconnected_cb(uint8_t reason_code)
297297
{
298+
struct wpa_sm *sm = &gWpaSm;
299+
298300
switch (reason_code) {
299301
case WIFI_REASON_AUTH_EXPIRE:
300302
case WIFI_REASON_CLASS2_FRAME_FROM_NONAUTH_STA:
@@ -308,7 +310,7 @@ static void wpa_sta_disconnected_cb(uint8_t reason_code)
308310
case WIFI_REASON_INVALID_MDE:
309311
case WIFI_REASON_INVALID_FTE:
310312
wpa_sta_clear_curr_pmksa();
311-
wpa_sm_notify_disassoc(&gWpaSm);
313+
wpa_sm_notify_disassoc(sm);
312314
#if defined(CONFIG_IEEE80211R)
313315
/* clear all ft auth related IEs so that next will be open auth */
314316
wpa_sta_clear_ft_auth_ie();
@@ -321,6 +323,13 @@ static void wpa_sta_disconnected_cb(uint8_t reason_code)
321323
break;
322324
}
323325

326+
sm->rx_replay_counter_set = 0; //init state not intall replay counter value
327+
memset(sm->rx_replay_counter, 0, WPA_REPLAY_COUNTER_LEN);
328+
sm->wpa_ptk_rekey = 0;
329+
pmksa_cache_clear_current(sm);
330+
sm->sae_pk = false;
331+
sm->eapol1_count = 0;
332+
324333
struct wps_sm_funcs *wps_sm_cb = wps_get_wps_sm_cb();
325334
if (wps_sm_cb && wps_sm_cb->wps_sm_notify_deauth) {
326335
wps_sm_cb->wps_sm_notify_deauth();

components/wpa_supplicant/src/rsn_supp/wpa.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2340,15 +2340,11 @@ int wpa_set_bss(char *macddr, char * bssid, u8 pairwise_cipher, u8 group_cipher,
23402340

23412341
sm->pairwise_cipher = BIT(pairwise_cipher);
23422342
sm->group_cipher = BIT(group_cipher);
2343-
sm->rx_replay_counter_set = 0; //init state not intall replay counter value
2344-
memset(sm->rx_replay_counter, 0, WPA_REPLAY_COUNTER_LEN);
2345-
sm->wpa_ptk_rekey = 0;
23462343
sm->renew_snonce = 1;
23472344
memcpy(sm->own_addr, macddr, ETH_ALEN);
23482345
memcpy(sm->bssid, bssid, ETH_ALEN);
23492346
sm->ap_notify_completed_rsne = esp_wifi_sta_is_ap_notify_completed_rsne_internal();
23502347
sm->use_ext_key_id = (sm->proto == WPA_PROTO_WPA);
2351-
pmksa_cache_clear_current(sm);
23522348
sm->sae_pwe = esp_wifi_get_config_sae_pwe_h2e_internal(WIFI_IF_STA);
23532349

23542350
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,
23712367
}
23722368
}
23732369

2374-
sm->eapol1_count = 0;
23752370
#ifdef CONFIG_IEEE80211W
23762371
if (esp_wifi_sta_pmf_enabled()) {
23772372
wifi_config_t wifi_cfg;

0 commit comments

Comments
 (0)