mirror of
https://github.com/espressif/esp-idf
synced 2025-03-09 17:19:09 -04:00
Merge branch 'feature/softap_detect_wrong_password_attempt' into 'master'
esp_wifi: softAP: detect external station attempting to connect with wrong password Closes IDFGH-13377 See merge request espressif/esp-idf!24586
This commit is contained in:
commit
fae82cfaa0
@ -1019,6 +1019,8 @@ typedef enum {
|
||||
|
||||
WIFI_EVENT_STA_NEIGHBOR_REP, /**< Received Neighbor Report response */
|
||||
|
||||
WIFI_EVENT_AP_WRONG_PASSWORD, /**< a station tried to connect with wrong password */
|
||||
|
||||
WIFI_EVENT_MAX, /**< Invalid Wi-Fi event ID */
|
||||
} wifi_event_t;
|
||||
|
||||
@ -1313,6 +1315,11 @@ typedef struct {
|
||||
uint16_t report_len; /**< Length of the report*/
|
||||
} wifi_event_neighbor_report_t;
|
||||
|
||||
/** Argument structure for WIFI_EVENT_AP_WRONG_PASSWORD event */
|
||||
typedef struct {
|
||||
uint8_t mac[6]; /**< MAC address of the station trying to connect to Soft-AP */
|
||||
} wifi_event_ap_wrong_password_t;
|
||||
|
||||
/**
|
||||
* @brief Argument structure for wifi_tx_rate_config
|
||||
*/
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit df42b857ede33d672362fdc5e0178f5d2bd91595
|
||||
Subproject commit 4cc66f055399501950062ad1a4a1349fe02304c9
|
@ -625,6 +625,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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user