From d2ba44d9e1ce89bda26e04720db800ce59ae2ca9 Mon Sep 17 00:00:00 2001 From: Sarvesh Bodakhe Date: Wed, 8 Jan 2025 16:46:03 +0530 Subject: [PATCH] fix(wifi): Add support to recongize different WPA3 Authentication modes from specs 1. Add support to recognize APs supporting 'WPA3-Enterprise-Only Mode' and 'WPA3-Enterprise-Transition Mode' using authmodes WIFI_AUTH_WPA3_ENTERPRISE and WIFI_AUTH_WPA2_WPA3_ENTERPRISE, respectively. 2. Add placeholder enums in 'wifi_auth_mode_t' for maintaining forward compatibility with minor versions > v5.2 --- components/esp_wifi/include/esp_wifi_types.h | 11 +++++++++-- components/esp_wifi/lib | 2 +- examples/wifi/scan/main/scan.c | 6 ++++++ 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/components/esp_wifi/include/esp_wifi_types.h b/components/esp_wifi/include/esp_wifi_types.h index 58748a403b..e7c9f4472c 100644 --- a/components/esp_wifi/include/esp_wifi_types.h +++ b/components/esp_wifi/include/esp_wifi_types.h @@ -55,8 +55,12 @@ typedef struct { wifi_country_policy_t policy; /**< country policy */ } wifi_country_t; -/* Strength of authmodes */ -/* OPEN < WEP < WPA_PSK < OWE < WPA2_PSK = WPA_WPA2_PSK < WAPI_PSK < WPA3_PSK = WPA2_WPA3_PSK */ +/** + * @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 + */ typedef enum { WIFI_AUTH_OPEN = 0, /**< authenticate mode : open */ WIFI_AUTH_WEP, /**< authenticate mode : WEP */ @@ -72,6 +76,9 @@ typedef enum { WIFI_AUTH_WPA3_ENT_192, /**< authenticate mode : WPA3_ENT_SUITE_B_192_BIT */ WIFI_AUTH_WPA3_EXT_PSK, /**< this authentication mode will yield same result as WIFI_AUTH_WPA3_PSK and not recommended to be used. It will be deprecated in future, please use WIFI_AUTH_WPA3_PSK instead. */ WIFI_AUTH_WPA3_EXT_PSK_MIXED_MODE, /**< this authentication mode will yield same result as WIFI_AUTH_WPA3_PSK and not recommended to be used. It will be deprecated in future, please use WIFI_AUTH_WPA3_PSK instead.*/ + WIFI_AUTH_DUMMY_1, /**< 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; diff --git a/components/esp_wifi/lib b/components/esp_wifi/lib index 130c3b5438..ab7d683cf6 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit 130c3b543846223544aed82d00c7e18c87d0e000 +Subproject commit ab7d683cf60a7cf18b118c85e10b0840c3b968b2 diff --git a/examples/wifi/scan/main/scan.c b/examples/wifi/scan/main/scan.c index 03ff6cd44c..93a181b7cc 100644 --- a/examples/wifi/scan/main/scan.c +++ b/examples/wifi/scan/main/scan.c @@ -52,6 +52,12 @@ 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;