Merge branch 'revert/use_wpa3_ent_authmode_naming_v5.1' into 'release/v5.1'

fix(wifi): Revert support for WPA3 Enterprise mode and add support for WIFI_EVENT_AP_WRONG_PASSWORD (v5.1)

See merge request espressif/esp-idf!36616
This commit is contained in:
Jiang Jiang Jian
2025-02-10 16:24:54 +08:00
5 changed files with 17 additions and 13 deletions

View File

@@ -59,7 +59,7 @@ typedef struct {
* @brief Wi-Fi authmode type
* Strength of authmodes
* Personal Networks : OPEN < WEP < WPA_PSK < OWE < WPA2_PSK = WPA_WPA2_PSK < WAPI_PSK < WPA3_PSK = WPA2_WPA3_PSK
* Enterprise Networks : WIFI_AUTH_WPA2_ENTERPRISE < WIFI_AUTH_WPA3_ENTERPRISE = WIFI_AUTH_WPA2_WPA3_ENTERPRISE < WIFI_AUTH_WPA3_ENT_192
* Enterprise Networks : WIFI_AUTH_WPA2_ENTERPRISE < WIFI_AUTH_WPA3_ENT_192
*/
typedef enum {
WIFI_AUTH_OPEN = 0, /**< authenticate mode : open */
@@ -74,11 +74,6 @@ typedef enum {
WIFI_AUTH_WAPI_PSK, /**< authenticate mode : WAPI_PSK */
WIFI_AUTH_OWE, /**< authenticate mode : OWE */
WIFI_AUTH_WPA3_ENT_192, /**< authenticate mode : WPA3_ENT_SUITE_B_192_BIT */
WIFI_AUTH_DUMMY_1, /**< Dummy placeholder authenticate mode for WIFI_AUTH_WPA3_EXT_PSK */
WIFI_AUTH_DUMMY_2, /**< Dummy placeholder authenticate mode for WIFI_AUTH_WPA3_EXT_PSK_MIXED_MODE */
WIFI_AUTH_DUMMY_3, /**< Dummy placeholder authenticate mode for WIFI_AUTH_DPP */
WIFI_AUTH_WPA3_ENTERPRISE, /**< authenticate mode : WPA3-Enterprise Only Mode */
WIFI_AUTH_WPA2_WPA3_ENTERPRISE, /**< authenticate mode : WPA3-Enterprise Transition Mode */
WIFI_AUTH_MAX
} wifi_auth_mode_t;
@@ -919,6 +914,8 @@ typedef enum {
WIFI_EVENT_NDP_CONFIRM, /**< NDP Confirm Indication */
WIFI_EVENT_NDP_TERMINATED, /**< NAN Datapath terminated indication */
WIFI_EVENT_AP_WRONG_PASSWORD, /**< a station tried to connect with wrong password */
WIFI_EVENT_MAX, /**< Invalid WiFi event ID */
} wifi_event_t;
@@ -1151,6 +1148,11 @@ typedef struct {
bool dcm; /**< Using dcm rate to send frame */
} wifi_tx_rate_config_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;
#ifdef __cplusplus
}
#endif

View File

@@ -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;

View File

@@ -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;
}

View File

@@ -52,12 +52,6 @@ static void print_auth_mode(int authmode)
case WIFI_AUTH_WPA2_WPA3_PSK:
ESP_LOGI(TAG, "Authmode \tWIFI_AUTH_WPA2_WPA3_PSK");
break;
case WIFI_AUTH_WPA3_ENTERPRISE:
ESP_LOGI(TAG, "Authmode \tWIFI_AUTH_WPA3_ENTERPRISE");
break;
case WIFI_AUTH_WPA2_WPA3_ENTERPRISE:
ESP_LOGI(TAG, "Authmode \tWIFI_AUTH_WPA2_WPA3_ENTERPRISE");
break;
case WIFI_AUTH_WPA3_ENT_192:
ESP_LOGI(TAG, "Authmode \tWIFI_AUTH_WPA3_ENT_192");
break;