mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-20 08:39:05 +00:00
esp_wifi: WPA3 softap set PMF required true
1) Set NVS PMF required true if not specified by application when authmode is WPA3 2) Fix issue regarding cleanup of non associated sta_info 3) Fix implementation of sta lock to avoid concurrency issues 4) Fix softAP deinit crash when password is configured with max length
This commit is contained in:
@@ -291,9 +291,8 @@ void hostapd_config_clear_wpa_psk(struct hostapd_wpa_psk **l)
|
||||
void hostapd_config_free_bss(struct hostapd_bss_config *conf)
|
||||
{
|
||||
hostapd_config_clear_wpa_psk(&conf->ssid.wpa_psk);
|
||||
str_clear_free(conf->ssid.wpa_passphrase);
|
||||
#ifdef CONFIG_SAE
|
||||
sae_deinit_pt(conf->ssid.pt);
|
||||
sae_deinit_pt(conf->ssid.pt);
|
||||
#endif /* CONFIG_SAE */
|
||||
os_free(conf);
|
||||
}
|
||||
|
@@ -385,6 +385,6 @@ struct sta_info;
|
||||
bool wpa_ap_join(struct sta_info *sta, uint8_t *bssid, uint8_t *wpa_ie,
|
||||
uint8_t wpa_ie_len,uint8_t *rsnxe, uint8_t rsnxe_len,
|
||||
bool *pmf_enable, int subtype);
|
||||
bool wpa_ap_remove(void* sta_info);
|
||||
bool wpa_ap_remove(u8* bssid);
|
||||
|
||||
#endif /* HOSTAPD_CONFIG_H */
|
||||
|
@@ -109,7 +109,7 @@ void ap_free_sta(struct hostapd_data *hapd, struct sta_info *sta)
|
||||
sae_clear_data(sta->sae);
|
||||
os_free(sta->sae);
|
||||
if (sta->lock) {
|
||||
os_mutex_unlock(sta->lock);
|
||||
os_semphr_give(sta->lock);
|
||||
os_mutex_delete(sta->lock);
|
||||
sta->lock = NULL;
|
||||
}
|
||||
@@ -175,7 +175,7 @@ struct sta_info * ap_sta_add(struct hostapd_data *hapd, const u8 *addr)
|
||||
#ifdef CONFIG_SAE
|
||||
sta->sae_commit_processing = false;
|
||||
sta->remove_pending = false;
|
||||
sta->lock = os_mutex_create();
|
||||
sta->lock = os_semphr_create(1, 1);
|
||||
#endif /* CONFIG_SAE */
|
||||
|
||||
return sta;
|
||||
|
@@ -2578,19 +2578,21 @@ static void ap_free_sta_timeout(void *ctx, void *data)
|
||||
}
|
||||
#endif
|
||||
|
||||
bool wpa_ap_remove(void* sta_info)
|
||||
bool wpa_ap_remove(u8* bssid)
|
||||
{
|
||||
struct hostapd_data *hapd = hostapd_get_hapd_data();
|
||||
|
||||
if (!sta_info || !hapd) {
|
||||
if (!hapd) {
|
||||
return false;
|
||||
}
|
||||
struct sta_info *sta = ap_get_sta(hapd, bssid);
|
||||
if (!sta) {
|
||||
return false;
|
||||
}
|
||||
struct sta_info *sta = NULL;
|
||||
sta = (struct sta_info*)sta_info;
|
||||
|
||||
#ifdef CONFIG_SAE
|
||||
if (sta->lock) {
|
||||
if (os_mutex_lock(sta->lock)) {
|
||||
if (os_semphr_take(sta->lock, 0)) {
|
||||
ap_free_sta(hapd, sta);
|
||||
} else {
|
||||
sta->remove_pending = true;
|
||||
|
Reference in New Issue
Block a user