mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-30 18:57:19 +02:00
fix(wifi): Make sure auth is sent after sae process
This commit is contained in:
@ -526,6 +526,11 @@ static void wpa3_process_rx_confirm(wpa3_hostap_auth_event_t *evt)
|
||||
goto done;
|
||||
}
|
||||
if (ret == WLAN_STATUS_SUCCESS) {
|
||||
if (sta->sae_data && esp_send_sae_auth_reply(hapd, sta->addr, frm->bssid, WLAN_AUTH_SAE, 2,
|
||||
WLAN_STATUS_SUCCESS, wpabuf_head(sta->sae_data), wpabuf_len(sta->sae_data)) != ESP_OK) {
|
||||
ap_free_sta(hapd, sta);
|
||||
goto done;
|
||||
}
|
||||
if (esp_wifi_ap_notify_node_sae_auth_done(frm->bssid) != true) {
|
||||
ap_free_sta(hapd, sta);
|
||||
goto done;
|
||||
@ -541,6 +546,10 @@ static void wpa3_process_rx_confirm(wpa3_hostap_auth_event_t *evt)
|
||||
}
|
||||
}
|
||||
done:
|
||||
if (sta && sta->sae_data) {
|
||||
wpabuf_free(sta->sae_data);
|
||||
sta->sae_data = NULL;
|
||||
}
|
||||
os_free(frm);
|
||||
}
|
||||
|
||||
|
@ -180,13 +180,16 @@ static int auth_sae_send_confirm(struct hostapd_data *hapd,
|
||||
if (sta->remove_pending) {
|
||||
reply_res = -1;
|
||||
} else {
|
||||
reply_res = esp_send_sae_auth_reply(hapd, sta->addr, bssid, WLAN_AUTH_SAE, 2,
|
||||
WLAN_STATUS_SUCCESS, wpabuf_head(data),
|
||||
wpabuf_len(data));
|
||||
if (sta->sae_data)
|
||||
wpabuf_free(data);
|
||||
sta->sae_data = data;
|
||||
reply_res = 0;
|
||||
/* confirm is sent in later stage when all the required processing for a sta is done*/
|
||||
}
|
||||
#else
|
||||
wpabuf_free(data);
|
||||
#endif /* ESP_SUPPLICANT */
|
||||
|
||||
wpabuf_free(data);
|
||||
return reply_res;
|
||||
}
|
||||
|
||||
|
@ -113,6 +113,10 @@ void ap_free_sta(struct hostapd_data *hapd, struct sta_info *sta)
|
||||
os_mutex_delete(sta->lock);
|
||||
sta->lock = NULL;
|
||||
}
|
||||
if (sta->sae_data) {
|
||||
wpabuf_free(sta->sae_data);
|
||||
sta->sae_data = NULL;
|
||||
}
|
||||
#endif /* CONFIG_SAE */
|
||||
wpa_auth_sta_deinit(sta->wpa_sm);
|
||||
#ifdef CONFIG_WPS_REGISTRAR
|
||||
|
@ -66,6 +66,7 @@ struct sta_info {
|
||||
* processing commit for that station */
|
||||
bool remove_pending; /* Flag to indicate to free station when
|
||||
* whose mutex is taken by task */
|
||||
struct wpabuf *sae_data;
|
||||
#endif /* CONFIG_SAE */
|
||||
#endif /* ESP_SUPPLICANT */
|
||||
|
||||
|
Reference in New Issue
Block a user