This is an automated email from the ASF dual-hosted git repository.
archer pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new b739b2b18a xtensa/esp32s3: Support WPA3 on softap mode
b739b2b18a is described below
commit b739b2b18ae83151345d2cdf5c7ae73998092d0b
Author: [email protected] <[email protected]>
AuthorDate: Fri Dec 29 19:35:25 2023 +0800
xtensa/esp32s3: Support WPA3 on softap mode
Signed-off-by: [email protected] <[email protected]>
---
arch/xtensa/src/esp32s3/Kconfig | 14 +++++++++++
arch/xtensa/src/esp32s3/Make.defs | 2 +-
arch/xtensa/src/esp32s3/Wireless.mk | 32 ++++++++++++++++++++++++++
arch/xtensa/src/esp32s3/esp32s3_wifi_adapter.c | 19 +++++++++++++--
4 files changed, 64 insertions(+), 3 deletions(-)
diff --git a/arch/xtensa/src/esp32s3/Kconfig b/arch/xtensa/src/esp32s3/Kconfig
index 0568c64e74..04e4e86e10 100644
--- a/arch/xtensa/src/esp32s3/Kconfig
+++ b/arch/xtensa/src/esp32s3/Kconfig
@@ -1407,6 +1407,20 @@ config ESP32S3_WIFI_STATION_SOFTAP
endchoice # ESP32S3 Wi-Fi mode
+config ESP_WIFI_ENABLE_SAE_PK
+ bool "Enable SAE-PK"
+ default y
+ ---help---
+ Select this option to enable SAE-PK
+
+config ESP_WIFI_ENABLE_WPA3_OWE_STA
+ bool "Enable OWE STA"
+ default y
+ ---help---
+ Select this option to allow the device to establish OWE
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 ESP32S3_WIFI_STATIC_RXBUF_NUM
int "Wi-Fi static RX buffer number"
default 10
diff --git a/arch/xtensa/src/esp32s3/Make.defs
b/arch/xtensa/src/esp32s3/Make.defs
index 3dd9169823..d6563457cc 100644
--- a/arch/xtensa/src/esp32s3/Make.defs
+++ b/arch/xtensa/src/esp32s3/Make.defs
@@ -191,7 +191,7 @@ endif
ESP_HAL_3RDPARTY_REPO = esp-hal-3rdparty
ifndef ESP_HAL_3RDPARTY_VERSION
- ESP_HAL_3RDPARTY_VERSION = 22804823777dbbb7f43925b7729b3a32331aa7cd
+ ESP_HAL_3RDPARTY_VERSION = 72cebefc6238637ae0a0ec6641fa4e2a0faa4901
endif
ifndef ESP_HAL_3RDPARTY_URL
diff --git a/arch/xtensa/src/esp32s3/Wireless.mk
b/arch/xtensa/src/esp32s3/Wireless.mk
index 9ca8d91fa8..224f6eaf15 100644
--- a/arch/xtensa/src/esp32s3/Wireless.mk
+++ b/arch/xtensa/src/esp32s3/Wireless.mk
@@ -87,6 +87,20 @@ CHIP_CSRCS += platform.c
CHIP_CSRCS += sha1.c
CHIP_CSRCS += sha256.c
CHIP_CSRCS += sha512.c
+CHIP_CSRCS += pk.c
+CHIP_CSRCS += pk_wrap.c
+CHIP_CSRCS += pkparse.c
+CHIP_CSRCS += ecdsa.c
+CHIP_CSRCS += asn1parse.c
+CHIP_CSRCS += asn1write.c
+CHIP_CSRCS += rsa.c
+CHIP_CSRCS += md5.c
+CHIP_CSRCS += oid.c
+CHIP_CSRCS += pem.c
+CHIP_CSRCS += hmac_drbg.c
+CHIP_CSRCS += hash_info.c
+CHIP_CSRCS += rsa_alt_helpers.c
+CHIP_CSRCS += ecdh.c
VPATH +=
chip$(DELIM)$(ESP_HAL_3RDPARTY_REPO)$(DELIM)components$(DELIM)mbedtls$(DELIM)port
@@ -113,6 +127,16 @@ CFLAGS += $(DEFINE_PREFIX)ESP_SUPPLICANT
CFLAGS += $(DEFINE_PREFIX)ESPRESSIF_USE
CFLAGS += $(DEFINE_PREFIX)IEEE8021X_EAPOL
CFLAGS += $(DEFINE_PREFIX)USE_WPA2_TASK
+CFLAGS += $(DEFINE_PREFIX)CONFIG_SHA256
+CFLAGS += $(DEFINE_PREFIX)CONFIG_SAE
+
+ifeq ($(CONFIG_ESP_WIFI_ENABLE_SAE_PK),y)
+CFLAGS += $(DEFINE_PREFIX)CONFIG_SAE_PK
+endif
+
+ifeq ($(CONFIG_ESP_WIFI_ENABLE_WPA3_OWE_STA),y)
+CFLAGS += $(DEFINE_PREFIX)CONFIG_OWE_STA
+endif
ifeq ($(CONFIG_ESP_WIFI_GCMP_SUPPORT),y)
CFLAGS += $(DEFINE_PREFIX)CONFIG_GCMP
@@ -131,6 +155,7 @@ INCLUDES +=
$(INCDIR_PREFIX)$(ARCH_SRCDIR)$(DELIM)$(WIFI_WPA_SUPPLICANT)$(DELIM)
CHIP_CSRCS += ap_config.c
CHIP_CSRCS += ieee802_11.c
+CHIP_CSRCS += comeback_token.c
CHIP_CSRCS += pmksa_cache_auth.c
CHIP_CSRCS += sta_info.c
CHIP_CSRCS += wpa_auth_ie.c
@@ -143,6 +168,10 @@ INCLUDES +=
$(INCDIR_PREFIX)$(ARCH_SRCDIR)$(DELIM)$(WIFI_WPA_SUPPLICANT)$(DELIM)
CHIP_CSRCS += dragonfly.c
CHIP_CSRCS += sae.c
CHIP_CSRCS += wpa_common.c
+CHIP_CSRCS += sae_pk.c
+CHIP_CSRCS += bss.c
+CHIP_CSRCS += scan.c
+CHIP_CSRCS += ieee802_11_common.c
VPATH += $(WIFI_WPA_SUPPLICANT)$(DELIM)src$(DELIM)crypto
@@ -213,6 +242,8 @@ CHIP_CSRCS += esp_wpa_main.c
CHIP_CSRCS += esp_wpa2.c
CHIP_CSRCS += esp_wpa3.c
CHIP_CSRCS += esp_wpas_glue.c
+CHIP_CSRCS += esp_owe.c
+CHIP_CSRCS += esp_scan.c
VPATH += $(WIFI_WPA_SUPPLICANT)$(DELIM)esp_supplicant$(DELIM)src$(DELIM)crypto
@@ -223,5 +254,6 @@ CHIP_CSRCS += crypto_mbedtls-ec.c
CHIP_CSRCS += crypto_mbedtls-rsa.c
CHIP_CSRCS += crypto_mbedtls.c
CHIP_CSRCS += tls_mbedtls.c
+CHIP_CSRCS += aes-siv.c
endif
diff --git a/arch/xtensa/src/esp32s3/esp32s3_wifi_adapter.c
b/arch/xtensa/src/esp32s3/esp32s3_wifi_adapter.c
index 74c40e541b..daf72babd5 100644
--- a/arch/xtensa/src/esp32s3/esp32s3_wifi_adapter.c
+++ b/arch/xtensa/src/esp32s3/esp32s3_wifi_adapter.c
@@ -116,6 +116,8 @@
# define DEFAULT_PS_MODE WIFI_PS_NONE
#endif
+#define ESP_MAX_PRIORITIES (25)
+
/****************************************************************************
* Private Types
****************************************************************************/
@@ -1810,8 +1812,14 @@ static int32_t esp_task_create_pinned_to_core(void
*entry,
cpu_set_t cpuset;
#endif
- pid = kthread_create(name, prio, stack_depth, entry,
- (char * const *)param);
+ uint32_t target_prio = prio;
+ if (target_prio < ESP_MAX_PRIORITIES)
+ {
+ target_prio += esp_task_get_max_priority() - ESP_MAX_PRIORITIES;
+ }
+
+ pid = kthread_create(name, target_prio, stack_depth, entry,
+ (char * const *)param);
if (pid > 0)
{
if (task_handle != NULL)
@@ -6476,6 +6484,13 @@ int esp_wifi_softap_auth(struct iwreq *iwr, bool set)
wifi_cfg.ap.authmode = WIFI_AUTH_WPA2_PSK;
break;
+ case IW_AUTH_WPA_VERSION_WPA3:
+ wifi_cfg.ap.pmf_cfg.required = true;
+ wifi_cfg.ap.pmf_cfg.capable = false;
+ wifi_cfg.ap.sae_pwe_h2e = WPA3_SAE_PWE_BOTH;
+ wifi_cfg.ap.authmode = WIFI_AUTH_WPA3_PSK;
+ break;
+
default:
wlerr("Invalid wpa version %" PRId32 "\n",
iwr->u.param.value);