feat(esp8266): add menuconfig for WPA3

This commit is contained in:
Zhang Jun Hao
2020-05-26 10:29:32 +08:00
parent 7192a85b2d
commit b6fc3c493d
3 changed files with 27 additions and 1 deletions

View File

@ -142,8 +142,10 @@ config RESET_REASON
config WIFI_PPT_TASKSTACK_SIZE config WIFI_PPT_TASKSTACK_SIZE
int "ppT task stack size" int "ppT task stack size"
default 2048
range 2048 8192 range 2048 8192
default 2048 if !ESP8266_WIFI_ENABLE_WPA3_SAE
default 5120 if ESP8266_WIFI_ENABLE_WPA3_SAE
help help
Configure the "ppT task" stack size. This is the stack of the task Configure the "ppT task" stack size. This is the stack of the task
which calls promiscuous callback function. So if user's function is 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 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. 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 config ESP8266_WIFI_DEBUG_LOG_ENABLE
bool "Enable WiFi debug log" bool "Enable WiFi debug log"
default n default n

View File

@ -110,6 +110,7 @@ typedef struct {
uint8_t tx_buf_num; /**< WiFi TX buffer number */ uint8_t tx_buf_num; /**< WiFi TX buffer number */
uint8_t nvs_enable; /**< WiFi NVS flash enable flag */ uint8_t nvs_enable; /**< WiFi NVS flash enable flag */
uint8_t nano_enable; /**< Nano option for printf/scan family 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 */ uint32_t magic; /**< WiFi init magic number, it should be the last field */
} wifi_init_config_t; } wifi_init_config_t;
@ -146,6 +147,12 @@ typedef struct {
#define WIFI_NVS_ENABLED 0 #define WIFI_NVS_ENABLED 0
#endif #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_MAGIC 0x1F2F3F4F
#define WIFI_INIT_CONFIG_DEFAULT() { \ #define WIFI_INIT_CONFIG_DEFAULT() { \
@ -165,6 +172,7 @@ typedef struct {
.tx_buf_num = CONFIG_ESP8266_WIFI_TX_PKT_NUM,\ .tx_buf_num = CONFIG_ESP8266_WIFI_TX_PKT_NUM,\
.nvs_enable = WIFI_NVS_ENABLED,\ .nvs_enable = WIFI_NVS_ENABLED,\
.nano_enable = 0,\ .nano_enable = 0,\
.wpa3_sae_enable = WIFI_WPA3_ENABLED, \
.magic = WIFI_INIT_CONFIG_MAGIC\ .magic = WIFI_INIT_CONFIG_MAGIC\
}; };

View File

@ -139,6 +139,7 @@ typedef enum {
WIFI_CIPHER_TYPE_TKIP, /**< the cipher type is TKIP */ WIFI_CIPHER_TYPE_TKIP, /**< the cipher type is TKIP */
WIFI_CIPHER_TYPE_CCMP, /**< the cipher type is CCMP */ WIFI_CIPHER_TYPE_CCMP, /**< the cipher type is CCMP */
WIFI_CIPHER_TYPE_TKIP_CCMP, /**< the cipher type is TKIP and 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_UNKNOWN, /**< the cipher type is unknown */
} wifi_cipher_type_t; } wifi_cipher_type_t;
@ -221,6 +222,12 @@ typedef enum {
WIFI_BW_HT40, /* Bandwidth is HT40 */ WIFI_BW_HT40, /* Bandwidth is HT40 */
} wifi_bandwidth_t; } 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 */ /** @brief Soft-AP configuration settings for the ESP8266 */
typedef struct { typedef struct {
uint8_t ssid[32]; /**< SSID of ESP8266 soft-AP */ 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. */ 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_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_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; } wifi_sta_config_t;
/** @brief Configuration data for ESP8266 AP or STA. /** @brief Configuration data for ESP8266 AP or STA.