From 5af390c600479138d81e18d2c7fb8f158b6629c1 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Fri, 16 Feb 2024 17:15:41 +0200 Subject: [PATCH] hostap: Fix missing items in Kconfig and CMakeLists.txt files Various settings in Kconfig and CMakeLists.txt file were plain wrong or missing. Signed-off-by: Jukka Rissanen --- modules/hostap/CMakeLists.txt | 43 +++++++++++++++++------------------ modules/hostap/Kconfig | 26 ++++++++++++++++----- 2 files changed, 41 insertions(+), 28 deletions(-) diff --git a/modules/hostap/CMakeLists.txt b/modules/hostap/CMakeLists.txt index 50082e582e..19a8a67920 100644 --- a/modules/hostap/CMakeLists.txt +++ b/modules/hostap/CMakeLists.txt @@ -28,8 +28,6 @@ zephyr_library_compile_definitions( CONFIG_NO_CONFIG_BLOBS CONFIG_CTRL_IFACE CONFIG_NO_RANDOM_POOL - CONFIG_NO_WPA - CONFIG_NO_PBKDF2 CONFIG_SHA256 CONFIG_CTRL_IFACE_ZEPHYR CONFIG_SUITEB192 @@ -56,6 +54,10 @@ zephyr_library_compile_definitions_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_RRM CONFIG_RRM ) +zephyr_library_compile_definitions_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_ROBUST_AV + CONFIG_ROBUST_AV +) + zephyr_library_compile_definitions_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_MBO CONFIG_MBO ) @@ -98,8 +100,6 @@ zephyr_library_sources( ${HOSTAP_SRC_BASE}/utils/eloop.c ${HOSTAP_SRC_BASE}/utils/os_zephyr.c ${HOSTAP_SRC_BASE}/utils/wpa_debug_zephyr.c - ${HOSTAP_SRC_BASE}/crypto/crypto_none.c - ${HOSTAP_SRC_BASE}/crypto/tls_none.c ${HOSTAP_SRC_BASE}/l2_packet/l2_packet_zephyr.c ${HOSTAP_SRC_BASE}/drivers/driver_zephyr.c @@ -128,20 +128,20 @@ zephyr_library_sources( # Advanced features zephyr_library_sources_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_RRM - ${WPA_SUPPLICANT_BASE}/op_classes.c - ${WPA_SUPPLICANT_BASE}/rrm.c + ${WIFI_NM_WPA_SUPPLICANT_BASE}/op_classes.c + ${WIFI_NM_WPA_SUPPLICANT_BASE}/rrm.c ) zephyr_library_sources_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_WMM_AC - ${WPA_SUPPLICANT_BASE}/wmm_ac.c + ${WIFI_NM_WPA_SUPPLICANT_BASE}/wmm_ac.c ) zephyr_library_sources_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_ROBUST_AV - ${WPA_SUPPLICANT_BASE}/robust_av.c + ${WIFI_NM_WPA_SUPPLICANT_BASE}/robust_av.c ) zephyr_library_sources_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_MBO - ${WPA_SUPPLICANT_BASE}/mbo.c + ${WIFI_NM_WPA_SUPPLICANT_BASE}/mbo.c ) zephyr_library_sources_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_WNM - ${WPA_SUPPLICANT_BASE}/wnm_sta.c + ${WIFI_NM_WPA_SUPPLICANT_BASE}/wnm_sta.c ) zephyr_library_sources_ifdef(CONFIG_WPA_CLI @@ -206,21 +206,21 @@ zephyr_library_compile_definitions_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_AP ) -zephyr_library_sources_ifndef(CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO +zephyr_library_sources_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_NONE ${HOSTAP_SRC_BASE}/crypto/crypto_none.c ${HOSTAP_SRC_BASE}/crypto/tls_none.c ) -zephyr_library_compile_definitions_ifndef(CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO +zephyr_library_compile_definitions_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_NONE CONFIG_NO_WPA CONFIG_CRYPTO_INTERNAL ) -zephyr_library_compile_definitions_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO +zephyr_library_compile_definitions_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_WEP CONFIG_WEP ) -zephyr_library_sources_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO +zephyr_library_sources_ifndef(CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_NONE ${HOSTAP_SRC_BASE}/common/wpa_common.c ${HOSTAP_SRC_BASE}/rsn_supp/wpa.c ${HOSTAP_SRC_BASE}/rsn_supp/preauth.c @@ -238,10 +238,6 @@ zephyr_library_sources_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO ${HOSTAP_SRC_BASE}/crypto/sha384-prf.c ) -zephyr_library_sources_ifndef(CONFIG_WPA_SUPP_CRYPTO_ENTERPRISE - ${COMMON_SRC_BASE}/crypto/tls_none.c -) - zephyr_library_sources_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_WPA3 ${HOSTAP_SRC_BASE}/common/sae.c ${HOSTAP_SRC_BASE}/common/dragonfly.c @@ -255,10 +251,13 @@ zephyr_library_compile_definitions_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_WPA3 CONFIG_ECC ) -zephyr_library_include_directories_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO +zephyr_library_include_directories_ifndef(CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_NONE ${CMAKE_SOURCE_DIR} ) +zephyr_library_link_libraries_ifndef(CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_NONE + mbedTLS) + zephyr_library_sources_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P ${WIFI_NM_WPA_SUPPLICANT_BASE}/p2p_supplicant.c ${WIFI_NM_WPA_SUPPLICANT_BASE}/p2p_supplicant_sd.c @@ -312,9 +311,9 @@ zephyr_library_sources_ifndef(CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_NONE ${HOSTAP_SRC_BASE}/rsn_supp/preauth.c ${HOSTAP_SRC_BASE}/rsn_supp/wpa_ie.c -# ${HOSTAP_SRC_BASE}/crypto/crypto_mbedtls-bignum.c -# ${HOSTAP_SRC_BASE}/crypto/crypto_mbedtls-ec.c -# ${HOSTAP_SRC_BASE}/crypto/crypto_mbedtls.c + ${HOSTAP_SRC_BASE}/crypto/crypto_mbedtls-bignum.c + ${HOSTAP_SRC_BASE}/crypto/crypto_mbedtls-ec.c + ${HOSTAP_SRC_BASE}/crypto/crypto_mbedtls.c ${HOSTAP_SRC_BASE}/crypto/aes-wrap.c ${HOSTAP_SRC_BASE}/crypto/aes-unwrap.c ${HOSTAP_SRC_BASE}/crypto/rc4.c diff --git a/modules/hostap/Kconfig b/modules/hostap/Kconfig index 0265306695..10b9bf2fb7 100644 --- a/modules/hostap/Kconfig +++ b/modules/hostap/Kconfig @@ -10,9 +10,7 @@ menuconfig WIFI_NM_WPA_SUPPLICANT select POSIX_CLOCK select POSIX_SIGNAL select POSIX_API -# depends on !POSIX_API select NET_SOCKETS -# select NET_SOCKETS_POSIX_NAMES select NET_SOCKETS_PACKET select NET_SOCKETPAIR select NET_L2_WIFI_MGMT @@ -97,9 +95,8 @@ config WIFI_NM_WPA_SUPPLICANT_WEP choice WIFI_NM_WPA_SUPPLICANT_CRYPTO_BACKEND prompt "WPA supplicant crypto implementation" - default WIFI_NM_WPA_SUPPLICANT_CRYPTO_NONE default WIFI_NM_WPA_SUPPLICANT_CRYPTO_PSA if BUILD_WITH_TFM - default WIFI_NM_WPA_SUPPLICANT_CRYPTO if !BUILD_WITH_TFM + default WIFI_NM_WPA_SUPPLICANT_CRYPTO_LEGACY_BUILTIN if !BUILD_WITH_TFM help Select the crypto implementation to use for WPA supplicant. @@ -136,8 +133,6 @@ config WIFI_NM_WPA_SUPPLICANT_CRYPTO_PSA select MBEDTLS_ECP_C select MBEDTLS_CTR_DRBG_C select MBEDTLS_KEY_EXCHANGE_ALL_ENABLED - select MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED - select MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED config WIFI_NM_WPA_SUPPLICANT_CRYPTO_LEGACY_BUILTIN bool "Legacy Crypto support for WiFi" @@ -149,6 +144,12 @@ config WIFI_NM_WPA_SUPPLICANT_CRYPTO_LEGACY_BUILTIN select MBEDTLS_ECP_ALL_ENABLED select MBEDTLS_PKCS5_C select MBEDTLS_MAC_CMAC_ENABLED +# select MBEDTLS_CIPHER_MODE_CBC +# select MBEDTLS_CIPHER_MODE_CTR +# select MBEDTLS_LEGACY_CRYPTO_C +# select MBEDTLS_CTR_DRBG_C +# select MBEDTLS_PK_WRITE_C +# select MBEDTLS_KEY_EXCHANGE_ALL_ENABLED config WIFI_NM_WPA_SUPPLICANT_CRYPTO_NONE bool "No Crypto support for WiFi" @@ -370,4 +371,17 @@ config WPA_CRYPTO config WPA_SUPP_CRYPTO bool +config ROBUST_AV + bool + default y + depends on WIFI_NM_WPA_SUPPLICANT_ROBUST_AV + +config RRM + bool + default y + depends on WIFI_NM_WPA_SUPPLICANT_RRM + +config WMM_AC + bool + endif # WIFI_NM_WPA_SUPPLICANT