mirror of
https://github.com/espressif/esp-idf.git
synced 2025-10-09 22:21:10 +00:00
feat(wpa_supplicant): Add WIFI_EVENT_AP_WRONG_PASSWORD in SoftAP
This event is triggered when external station tries connecting to softAP with wrong password. Currently supported softAP AUTH modes: WPA-PSK, WPA2-PSK and WPA3-PSK (SAE-auth)
This commit is contained in:
@@ -624,6 +624,10 @@ int handle_auth_sae(struct hostapd_data *hapd, struct sta_info *sta,
|
||||
|
||||
if (sae_check_confirm(sta->sae, buf, len) < 0) {
|
||||
resp = WLAN_STATUS_CHALLENGE_FAIL;
|
||||
wifi_event_ap_wrong_password_t evt = {0};
|
||||
os_memcpy(evt.mac, bssid, ETH_ALEN);
|
||||
esp_event_post(WIFI_EVENT, WIFI_EVENT_AP_WRONG_PASSWORD, &evt,
|
||||
sizeof(evt), 0);
|
||||
goto reply;
|
||||
}
|
||||
sta->sae->rc = peer_send_confirm;
|
||||
|
@@ -1668,6 +1668,10 @@ SM_STATE(WPA_PTK, PTKCALCNEGOTIATING)
|
||||
|
||||
if (!ok) {
|
||||
wpa_printf(MSG_INFO, "invalid MIC in msg 2/4 of 4-Way Handshake");
|
||||
wifi_event_ap_wrong_password_t evt = {0};
|
||||
os_memcpy(evt.mac, sm->addr, ETH_ALEN);
|
||||
esp_event_post(WIFI_EVENT, WIFI_EVENT_AP_WRONG_PASSWORD, &evt,
|
||||
sizeof(evt), 0);
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user