Skip to content

Commit

Permalink
Merge branch 'bugfix/wpa3_softap_assoc_reject' into 'master'
Browse files Browse the repository at this point in the history
fix(wifi): wpa3 softap fix deauth when assoc req recv before sae is finished

Closes WIFIBUG-95

See merge request espressif/esp-idf!25545
  • Loading branch information
jack0c committed Nov 1, 2023
2 parents ef8a4dc + 8b8d4a0 commit 15f62f8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions components/wpa_supplicant/esp_supplicant/src/esp_wpa_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,12 +321,15 @@ static bool hostap_sta_join(void **sta, u8 *bssid, u8 *wpa_ie, u8 wpa_ie_len,u8
sta_info = ap_sta_add(hapd, bssid);
if (!sta_info) {
wpa_printf(MSG_ERROR, "failed to add station " MACSTR, MAC2STR(bssid));
return false;
goto fail;
}

#ifdef CONFIG_SAE
if (sta_info->lock && os_semphr_take(sta_info->lock, 0) != TRUE) {
wpa_printf(MSG_INFO, "Ignore assoc request as softap is busy with sae calculation for station "MACSTR, MAC2STR(bssid));
if (esp_send_assoc_resp(hapd, sta_info, bssid, WLAN_STATUS_ASSOC_REJECTED_TEMPORARILY, rsnxe ? false : true, subtype) != WLAN_STATUS_SUCCESS) {
goto fail;
}
return false;
}
#endif /* CONFIG_SAE */
Expand Down Expand Up @@ -357,10 +360,7 @@ static bool hostap_sta_join(void **sta, u8 *bssid, u8 *wpa_ie, u8 wpa_ie_len,u8
}

fail:
if (sta_info) {
ap_free_sta(hapd, sta_info);
}

esp_wifi_ap_deauth_internal(bssid, WLAN_REASON_PREV_AUTH_NOT_VALID);
return false;
}
#endif
Expand Down

0 comments on commit 15f62f8

Please sign in to comment.