diff --git a/components/esp8266/Kconfig b/components/esp8266/Kconfig index 33133855..0fc6ab46 100644 --- a/components/esp8266/Kconfig +++ b/components/esp8266/Kconfig @@ -142,8 +142,10 @@ config RESET_REASON config WIFI_PPT_TASKSTACK_SIZE int "ppT task stack size" - default 2048 range 2048 8192 + default 2048 if !ESP8266_WIFI_ENABLE_WPA3_SAE + default 5120 if ESP8266_WIFI_ENABLE_WPA3_SAE + help Configure the "ppT task" stack size. This is the stack of the task which calls promiscuous callback function. So if user's function is @@ -331,6 +333,14 @@ config ESP8266_WIFI_CONNECT_OPEN_ROUTER_WHEN_PWD_IS_SET When this option is enabled, ESP8266 will connect to open router even if wifi password is set, otherwise ESP8266 will not connect to open router when wifi password is set. +config ESP8266_WIFI_ENABLE_WPA3_SAE + bool "Enable WPA3-Personal" + default y + help + Select this option to allow the device to establish a WPA3-Personal connection with eligible AP's. + PMF (Protected Management Frames) is a prerequisite feature for a WPA3 connection, it needs to be + explicitly configured before attempting connection. Please refer to the Wi-Fi Driver API Guide for details. + config ESP8266_WIFI_DEBUG_LOG_ENABLE bool "Enable WiFi debug log" default n diff --git a/components/esp8266/include/esp_wifi.h b/components/esp8266/include/esp_wifi.h index e88defac..54592fd3 100644 --- a/components/esp8266/include/esp_wifi.h +++ b/components/esp8266/include/esp_wifi.h @@ -110,6 +110,7 @@ typedef struct { uint8_t tx_buf_num; /**< WiFi TX buffer number */ uint8_t nvs_enable; /**< WiFi NVS flash enable flag */ uint8_t nano_enable; /**< Nano option for printf/scan family enable flag */ + uint8_t wpa3_sae_enable; /**< WiFi WPA3 feature enable flag*/ uint32_t magic; /**< WiFi init magic number, it should be the last field */ } wifi_init_config_t; @@ -146,6 +147,12 @@ typedef struct { #define WIFI_NVS_ENABLED 0 #endif +#if CONFIG_ESP8266_WIFI_ENABLE_WPA3_SAE +#define WIFI_WPA3_ENABLED 1 +#else +#define WIFI_WPA3_ENABLED 0 +#endif + #define WIFI_INIT_CONFIG_MAGIC 0x1F2F3F4F #define WIFI_INIT_CONFIG_DEFAULT() { \ @@ -165,6 +172,7 @@ typedef struct { .tx_buf_num = CONFIG_ESP8266_WIFI_TX_PKT_NUM,\ .nvs_enable = WIFI_NVS_ENABLED,\ .nano_enable = 0,\ + .wpa3_sae_enable = WIFI_WPA3_ENABLED, \ .magic = WIFI_INIT_CONFIG_MAGIC\ }; diff --git a/components/esp8266/include/esp_wifi_types.h b/components/esp8266/include/esp_wifi_types.h index 1aec66cf..ac33bfb1 100755 --- a/components/esp8266/include/esp_wifi_types.h +++ b/components/esp8266/include/esp_wifi_types.h @@ -139,6 +139,7 @@ typedef enum { WIFI_CIPHER_TYPE_TKIP, /**< the cipher type is TKIP */ WIFI_CIPHER_TYPE_CCMP, /**< the cipher type is CCMP */ WIFI_CIPHER_TYPE_TKIP_CCMP, /**< the cipher type is TKIP and CCMP */ + WIFI_CIPHER_TYPE_AES_CMAC128,/**< the cipher type is AES-CMAC-128 */ WIFI_CIPHER_TYPE_UNKNOWN, /**< the cipher type is unknown */ } wifi_cipher_type_t; @@ -221,6 +222,12 @@ typedef enum { WIFI_BW_HT40, /* Bandwidth is HT40 */ } wifi_bandwidth_t; +/** Configuration structure for Protected Management Frame */ +typedef struct { + bool capable; /**< Advertizes support for Protected Management Frame. Device will prefer to connect in PMF mode if other device also advertizes PMF capability. */ + bool required; /**< Advertizes that Protected Management Frame is required. Device will not associate to non-PMF capable devices. */ +} wifi_pmf_config_t; + /** @brief Soft-AP configuration settings for the ESP8266 */ typedef struct { uint8_t ssid[32]; /**< SSID of ESP8266 soft-AP */ @@ -244,6 +251,7 @@ typedef struct { uint16_t listen_interval; /**< Listen interval for ESP8266 station to receive beacon when WIFI_PS_MAX_MODEM is set. Units: AP beacon intervals. Defaults to 3 if set to 0. */ wifi_sort_method_t sort_method; /**< sort the connect AP in the list by rssi or security mode */ wifi_fast_scan_threshold_t threshold; /**< When scan_method is set to WIFI_FAST_SCAN, only APs which have an auth mode that is more secure than the selected auth mode and a signal stronger than the minimum RSSI will be used. */ + wifi_pmf_config_t pmf_cfg; /**< Configuration for Protected Management Frame. Will be advertized in RSN Capabilities in RSN IE. */ } wifi_sta_config_t; /** @brief Configuration data for ESP8266 AP or STA.