From e667d1af2e13160d3c2cd41b860fbcddf88c04ba Mon Sep 17 00:00:00 2001 From: Kapil Gupta Date: Fri, 7 May 2021 15:46:41 +0530 Subject: [PATCH] wpa_supplicant: bypass sonar checks for upstream code --- components/esp_common/src/esp_err_to_name.c | 16 ++++---- components/esp_wifi/test_md5/test_md5.sh | 2 +- components/wpa_supplicant/CMakeLists.txt | 25 +++++------ components/wpa_supplicant/README | 41 +++++++++++++++++++ components/wpa_supplicant/README.md | 8 ++++ components/wpa_supplicant/component.mk | 12 +++--- .../include}/esp_dpp.h | 0 .../include}/esp_rrm.h | 0 .../include}/esp_wnm.h | 0 .../include}/esp_wpa.h | 0 .../include}/esp_wpa2.h | 0 .../include}/esp_wps.h | 0 .../src}/esp_common.c | 4 +- .../src}/esp_common_i.h | 0 .../src}/esp_dpp.c | 0 .../src}/esp_dpp_i.h | 0 .../src}/esp_hostap.c | 0 .../src}/esp_hostap.h | 0 .../src}/esp_scan.c | 2 +- .../src}/esp_scan_i.h | 0 .../src}/esp_wifi_driver.h | 0 .../src}/esp_wpa2.c | 0 .../src}/esp_wpa3.c | 0 .../src}/esp_wpa3_i.h | 0 .../src}/esp_wpa_err.h | 0 .../src}/esp_wpa_main.c | 0 .../src}/esp_wpas_glue.c | 0 .../src}/esp_wpas_glue.h | 0 .../src}/esp_wps.c | 0 components/wpa_supplicant/src/ap/ap_config.c | 2 +- components/wpa_supplicant/src/ap/wpa_auth.c | 2 +- components/wpa_supplicant/src/common/bss.c | 2 +- .../src/common/ieee802_11_common.h | 2 +- components/wpa_supplicant/src/common/rrm.c | 4 +- .../wpa_supplicant/src/common/wpa_common.h | 2 +- components/wpa_supplicant/src/eap_peer/eap.c | 2 +- components/wpa_supplicant/src/rsn_supp/wpa.c | 4 +- components/wpa_supplicant/test/CMakeLists.txt | 4 +- .../wpa_supplicant/test/test_offchannel.c | 2 +- tools/ci/check_public_headers_exceptions.txt | 1 + tools/ci/sonar_exclude_list.txt | 4 ++ 41 files changed, 99 insertions(+), 42 deletions(-) create mode 100644 components/wpa_supplicant/README create mode 100644 components/wpa_supplicant/README.md rename components/wpa_supplicant/{include/esp_supplicant => esp_supplicant/include}/esp_dpp.h (100%) rename components/wpa_supplicant/{include/esp_supplicant => esp_supplicant/include}/esp_rrm.h (100%) rename components/wpa_supplicant/{include/esp_supplicant => esp_supplicant/include}/esp_wnm.h (100%) rename components/wpa_supplicant/{include/esp_supplicant => esp_supplicant/include}/esp_wpa.h (100%) rename components/wpa_supplicant/{include/esp_supplicant => esp_supplicant/include}/esp_wpa2.h (100%) rename components/wpa_supplicant/{include/esp_supplicant => esp_supplicant/include}/esp_wps.h (100%) rename components/wpa_supplicant/{src/esp_supplicant => esp_supplicant/src}/esp_common.c (99%) rename components/wpa_supplicant/{src/esp_supplicant => esp_supplicant/src}/esp_common_i.h (100%) rename components/wpa_supplicant/{src/esp_supplicant => esp_supplicant/src}/esp_dpp.c (100%) rename components/wpa_supplicant/{src/esp_supplicant => esp_supplicant/src}/esp_dpp_i.h (100%) rename components/wpa_supplicant/{src/esp_supplicant => esp_supplicant/src}/esp_hostap.c (100%) rename components/wpa_supplicant/{src/esp_supplicant => esp_supplicant/src}/esp_hostap.h (100%) rename components/wpa_supplicant/{src/esp_supplicant => esp_supplicant/src}/esp_scan.c (99%) rename components/wpa_supplicant/{src/esp_supplicant => esp_supplicant/src}/esp_scan_i.h (100%) rename components/wpa_supplicant/{src/esp_supplicant => esp_supplicant/src}/esp_wifi_driver.h (100%) rename components/wpa_supplicant/{src/esp_supplicant => esp_supplicant/src}/esp_wpa2.c (100%) rename components/wpa_supplicant/{src/esp_supplicant => esp_supplicant/src}/esp_wpa3.c (100%) rename components/wpa_supplicant/{src/esp_supplicant => esp_supplicant/src}/esp_wpa3_i.h (100%) rename components/wpa_supplicant/{src/esp_supplicant => esp_supplicant/src}/esp_wpa_err.h (100%) rename components/wpa_supplicant/{src/esp_supplicant => esp_supplicant/src}/esp_wpa_main.c (100%) rename components/wpa_supplicant/{src/esp_supplicant => esp_supplicant/src}/esp_wpas_glue.c (100%) rename components/wpa_supplicant/{src/esp_supplicant => esp_supplicant/src}/esp_wpas_glue.h (100%) rename components/wpa_supplicant/{src/esp_supplicant => esp_supplicant/src}/esp_wps.c (100%) diff --git a/components/esp_common/src/esp_err_to_name.c b/components/esp_common/src/esp_err_to_name.c index 460eafcf00..cc772c92e9 100644 --- a/components/esp_common/src/esp_err_to_name.c +++ b/components/esp_common/src/esp_err_to_name.c @@ -5,6 +5,9 @@ #if __has_include("soc/soc.h") #include "soc/soc.h" #endif +#if __has_include("esp_dpp.h") +#include "esp_dpp.h" +#endif #if __has_include("esp_efuse.h") #include "esp_efuse.h" #endif @@ -38,18 +41,15 @@ #if __has_include("esp_spi_flash.h") #include "esp_spi_flash.h" #endif -#if __has_include("esp_supplicant/esp_dpp.h") -#include "esp_supplicant/esp_dpp.h" -#endif -#if __has_include("esp_supplicant/esp_wps.h") -#include "esp_supplicant/esp_wps.h" -#endif #if __has_include("esp_tls_errors.h") #include "esp_tls_errors.h" #endif #if __has_include("esp_wifi.h") #include "esp_wifi.h" #endif +#if __has_include("esp_wps.h") +#include "esp_wps.h" +#endif #if __has_include("hal/esp_flash_err.h") #include "hal/esp_flash_err.h" #endif @@ -376,7 +376,7 @@ static const esp_err_msg_t esp_err_msg_table[] = { # ifdef ESP_ERR_WIFI_TX_DISALLOW ERR_TBL_IT(ESP_ERR_WIFI_TX_DISALLOW), /* 12310 0x3016 The WiFi TX is disallowed */ # endif - // components/wpa_supplicant/include/esp_supplicant/esp_wps.h + // components/wpa_supplicant/esp_supplicant/include/esp_wps.h # ifdef ESP_ERR_WIFI_REGISTRAR ERR_TBL_IT(ESP_ERR_WIFI_REGISTRAR), /* 12339 0x3033 WPS registrar is not supported */ # endif @@ -414,7 +414,7 @@ static const esp_err_msg_t esp_err_msg_table[] = { # ifdef ESP_ERR_ESPNOW_IF ERR_TBL_IT(ESP_ERR_ESPNOW_IF), /* 12396 0x306c Interface error */ # endif - // components/wpa_supplicant/include/esp_supplicant/esp_dpp.h + // components/wpa_supplicant/esp_supplicant/include/esp_dpp.h # ifdef ESP_ERR_DPP_FAILURE ERR_TBL_IT(ESP_ERR_DPP_FAILURE), /* 12439 0x3097 Generic failure during DPP Operation */ # endif diff --git a/components/esp_wifi/test_md5/test_md5.sh b/components/esp_wifi/test_md5/test_md5.sh index e51e36334a..635e5338c9 100755 --- a/components/esp_wifi/test_md5/test_md5.sh +++ b/components/esp_wifi/test_md5/test_md5.sh @@ -64,7 +64,7 @@ check_md5 ${IDF_PATH}/components/esp_wifi/include/esp_private/wifi_os_adapter.h check_md5 ${IDF_PATH}/components/esp_wifi/include/esp_wifi_crypto_types.h g_wifi_crypto_funcs_md5 check_md5 ${IDF_PATH}/components/esp_wifi/include/esp_wifi_types.h g_wifi_type_md5 check_md5 ${IDF_PATH}/components/esp_wifi/include/esp_coexist_adapter.h g_coex_adapter_funcs_md5 -check_md5 ${IDF_PATH}/components/wpa_supplicant/src/esp_supplicant/esp_wifi_driver.h g_wifi_supplicant_funcs_md5 +check_md5 ${IDF_PATH}/components/wpa_supplicant/esp_supplicant/src/esp_wifi_driver.h g_wifi_supplicant_funcs_md5 if [ $FAILURES -gt 0 ]; then exit 1 diff --git a/components/wpa_supplicant/CMakeLists.txt b/components/wpa_supplicant/CMakeLists.txt index 2e10bb82af..fa7f4de2bb 100644 --- a/components/wpa_supplicant/CMakeLists.txt +++ b/components/wpa_supplicant/CMakeLists.txt @@ -30,13 +30,6 @@ set(srcs "port/os_xtensa.c" "src/eap_peer/eap_tls_common.c" "src/eap_peer/eap_ttls.c" "src/eap_peer/mschapv2.c" - "src/esp_supplicant/esp_hostap.c" - "src/esp_supplicant/esp_wpa2.c" - "src/esp_supplicant/esp_wpa_main.c" - "src/esp_supplicant/esp_wpas_glue.c" - "src/esp_supplicant/esp_wps.c" - "src/esp_supplicant/esp_wpa3.c" - "src/esp_supplicant/esp_dpp.c" "src/rsn_supp/pmksa_cache.c" "src/rsn_supp/wpa.c" "src/rsn_supp/wpa_ie.c" @@ -57,6 +50,14 @@ set(srcs "port/os_xtensa.c" "src/wps/wps_registrar.c" "src/wps/wps_validate.c") +set(esp_srcs "esp_supplicant/src/esp_hostap.c" + "esp_supplicant/src/esp_wpa2.c" + "esp_supplicant/src/esp_wpa_main.c" + "esp_supplicant/src/esp_wpas_glue.c" + "esp_supplicant/src/esp_wps.c" + "esp_supplicant/src/esp_wpa3.c" + "esp_supplicant/src/esp_dpp.c") + if(CONFIG_WPA_MBEDTLS_CRYPTO) set(tls_src "src/crypto/tls_mbedtls.c") else() @@ -145,16 +146,16 @@ if(CONFIG_WPA_11KV_SUPPORT) "src/common/bss.c" "src/common/scan.c" "src/common/ieee802_11_common.c" - "src/esp_supplicant/esp_common.c" - "src/esp_supplicant/esp_scan.c" + "esp_supplicant/src/esp_common.c" + "esp_supplicant/src/esp_scan.c" ) else() set(roaming_src "") endif() -idf_component_register(SRCS "${srcs}" "${tls_src}" "${roaming_src}" "${crypto_src}" - INCLUDE_DIRS include port/include include/esp_supplicant - PRIV_INCLUDE_DIRS src src/utils +idf_component_register(SRCS "${srcs}" ${esp_srcs} "${tls_src}" "${roaming_src}" "${crypto_src}" + INCLUDE_DIRS include port/include esp_supplicant/include + PRIV_INCLUDE_DIRS src src/utils esp_supplicant/src PRIV_REQUIRES mbedtls esp_timer) target_compile_options(${COMPONENT_LIB} PRIVATE -Wno-strict-aliasing -Wno-write-strings) diff --git a/components/wpa_supplicant/README b/components/wpa_supplicant/README new file mode 100644 index 0000000000..ce871f5284 --- /dev/null +++ b/components/wpa_supplicant/README @@ -0,0 +1,41 @@ +wpa_supplicant and hostapd +-------------------------- + +Copyright (c) 2002-2019, Jouni Malinen and contributors +All Rights Reserved. + +These programs are licensed under the BSD license (the one with +advertisement clause removed). + +License +------- + +This software may be distributed, used, and modified under the terms of +BSD license: + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name(s) of the above-listed copyright holder(s) nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/components/wpa_supplicant/README.md b/components/wpa_supplicant/README.md new file mode 100644 index 0000000000..dcb2d412a3 --- /dev/null +++ b/components/wpa_supplicant/README.md @@ -0,0 +1,8 @@ +## 'wpa_supplicant' ## + +This component contains the upstream wpa_supplicant ported for ESP family of platforms. +The code is tightly coupled with esp_wifi component which has ESP WiFi libraries and header files that are used in ported supplicant. + +ESP uses MbedTLS as crypto library therefore MbedTLS component is also required for some features to work(see WPA_MBEDTLS_CRYPTO). + +To port it for different OS, esp_wifi and wpa_supplicant should be picked up a whole system(preferably with MbedTLS if we want all features to work.) diff --git a/components/wpa_supplicant/component.mk b/components/wpa_supplicant/component.mk index ace0d6258a..d1509dfa1e 100644 --- a/components/wpa_supplicant/component.mk +++ b/components/wpa_supplicant/component.mk @@ -1,8 +1,8 @@ # supplicant make file -COMPONENT_PRIV_INCLUDEDIRS := src src/utils -COMPONENT_SRCDIRS := port src/ap src/common src/crypto src/eap_peer src/rsn_supp src/tls src/utils src/esp_supplicant src/wps -COMPONENT_ADD_INCLUDEDIRS := include port/include include/esp_supplicant src/utils +COMPONENT_PRIV_INCLUDEDIRS := src src/utils esp_supplicant/src +COMPONENT_SRCDIRS := port src/ap src/common src/crypto src/eap_peer src/rsn_supp src/tls src/utils src/wps esp_supplicant/src +COMPONENT_ADD_INCLUDEDIRS := include port/include esp_supplicant/include src/utils ifeq ($(CONFIG_WPA_MBEDTLS_CRYPTO), y) COMPONENT_OBJEXCLUDE += src/tls/asn1.o \ @@ -67,14 +67,14 @@ ifneq ($(CONFIG_WPA_11KV_SUPPORT), y) src/common/bss.o \ src/common/scan.o \ src/common/ieee802_11_common.o \ - src/esp_supplicant/esp_common.o \ - src/esp_supplicant/esp_scan.o + esp_supplicant/src/esp_common.o \ + esp_supplicant/src/esp_scan.o endif CFLAGS += -DCONFIG_DPP -DCONFIG_IEEE80211W -DESP_SUPPLICANT -DIEEE8021X_EAPOL -DEAP_PEER_METHOD -DEAP_TLS -DEAP_TTLS -DEAP_PEAP -DEAP_MSCHAPv2 -DUSE_WPA2_TASK -DCONFIG_WPS2 -DCONFIG_WPS_PIN -DUSE_WPS_TASK -DESPRESSIF_USE -DESP32_WORKAROUND -DCONFIG_ECC -DCONFIG_WNM -D__ets__ -Wno-strict-aliasing ifdef CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE - CFLAGS += -DCONFIG_WPA3_SAE + CFLAGS += -DCONFIG_WPA3_SAE endif ifdef CONFIG_WPA_WPS_STRICT CFLAGS += -DCONFIG_WPS_STRICT diff --git a/components/wpa_supplicant/include/esp_supplicant/esp_dpp.h b/components/wpa_supplicant/esp_supplicant/include/esp_dpp.h similarity index 100% rename from components/wpa_supplicant/include/esp_supplicant/esp_dpp.h rename to components/wpa_supplicant/esp_supplicant/include/esp_dpp.h diff --git a/components/wpa_supplicant/include/esp_supplicant/esp_rrm.h b/components/wpa_supplicant/esp_supplicant/include/esp_rrm.h similarity index 100% rename from components/wpa_supplicant/include/esp_supplicant/esp_rrm.h rename to components/wpa_supplicant/esp_supplicant/include/esp_rrm.h diff --git a/components/wpa_supplicant/include/esp_supplicant/esp_wnm.h b/components/wpa_supplicant/esp_supplicant/include/esp_wnm.h similarity index 100% rename from components/wpa_supplicant/include/esp_supplicant/esp_wnm.h rename to components/wpa_supplicant/esp_supplicant/include/esp_wnm.h diff --git a/components/wpa_supplicant/include/esp_supplicant/esp_wpa.h b/components/wpa_supplicant/esp_supplicant/include/esp_wpa.h similarity index 100% rename from components/wpa_supplicant/include/esp_supplicant/esp_wpa.h rename to components/wpa_supplicant/esp_supplicant/include/esp_wpa.h diff --git a/components/wpa_supplicant/include/esp_supplicant/esp_wpa2.h b/components/wpa_supplicant/esp_supplicant/include/esp_wpa2.h similarity index 100% rename from components/wpa_supplicant/include/esp_supplicant/esp_wpa2.h rename to components/wpa_supplicant/esp_supplicant/include/esp_wpa2.h diff --git a/components/wpa_supplicant/include/esp_supplicant/esp_wps.h b/components/wpa_supplicant/esp_supplicant/include/esp_wps.h similarity index 100% rename from components/wpa_supplicant/include/esp_supplicant/esp_wps.h rename to components/wpa_supplicant/esp_supplicant/include/esp_wps.h diff --git a/components/wpa_supplicant/src/esp_supplicant/esp_common.c b/components/wpa_supplicant/esp_supplicant/src/esp_common.c similarity index 99% rename from components/wpa_supplicant/src/esp_supplicant/esp_common.c rename to components/wpa_supplicant/esp_supplicant/src/esp_common.c index 74f42498fc..eaa248a2fc 100644 --- a/components/wpa_supplicant/src/esp_supplicant/esp_common.c +++ b/components/wpa_supplicant/esp_supplicant/src/esp_common.c @@ -25,8 +25,8 @@ #include "common/rrm.h" #include "common/wnm_sta.h" #include "common/wpa_supplicant_i.h" -#include "esp_supplicant/esp_scan_i.h" -#include "esp_supplicant/esp_common_i.h" +#include "esp_scan_i.h" +#include "esp_common_i.h" #include "common/ieee802_11_common.h" #include "esp_rrm.h" #include "esp_wnm.h" diff --git a/components/wpa_supplicant/src/esp_supplicant/esp_common_i.h b/components/wpa_supplicant/esp_supplicant/src/esp_common_i.h similarity index 100% rename from components/wpa_supplicant/src/esp_supplicant/esp_common_i.h rename to components/wpa_supplicant/esp_supplicant/src/esp_common_i.h diff --git a/components/wpa_supplicant/src/esp_supplicant/esp_dpp.c b/components/wpa_supplicant/esp_supplicant/src/esp_dpp.c similarity index 100% rename from components/wpa_supplicant/src/esp_supplicant/esp_dpp.c rename to components/wpa_supplicant/esp_supplicant/src/esp_dpp.c diff --git a/components/wpa_supplicant/src/esp_supplicant/esp_dpp_i.h b/components/wpa_supplicant/esp_supplicant/src/esp_dpp_i.h similarity index 100% rename from components/wpa_supplicant/src/esp_supplicant/esp_dpp_i.h rename to components/wpa_supplicant/esp_supplicant/src/esp_dpp_i.h diff --git a/components/wpa_supplicant/src/esp_supplicant/esp_hostap.c b/components/wpa_supplicant/esp_supplicant/src/esp_hostap.c similarity index 100% rename from components/wpa_supplicant/src/esp_supplicant/esp_hostap.c rename to components/wpa_supplicant/esp_supplicant/src/esp_hostap.c diff --git a/components/wpa_supplicant/src/esp_supplicant/esp_hostap.h b/components/wpa_supplicant/esp_supplicant/src/esp_hostap.h similarity index 100% rename from components/wpa_supplicant/src/esp_supplicant/esp_hostap.h rename to components/wpa_supplicant/esp_supplicant/src/esp_hostap.h diff --git a/components/wpa_supplicant/src/esp_supplicant/esp_scan.c b/components/wpa_supplicant/esp_supplicant/src/esp_scan.c similarity index 99% rename from components/wpa_supplicant/src/esp_supplicant/esp_scan.c rename to components/wpa_supplicant/esp_supplicant/src/esp_scan.c index b63b52b9d7..e1e7ee18df 100644 --- a/components/wpa_supplicant/src/esp_supplicant/esp_scan.c +++ b/components/wpa_supplicant/esp_supplicant/src/esp_scan.c @@ -27,7 +27,7 @@ #include "common/bss.h" #include "common/rrm.h" #include "common/ieee802_11_common.h" -#include "esp_supplicant/esp_common_i.h" +#include "esp_common_i.h" #include "common/wnm_sta.h" extern struct wpa_supplicant g_wpa_supp; diff --git a/components/wpa_supplicant/src/esp_supplicant/esp_scan_i.h b/components/wpa_supplicant/esp_supplicant/src/esp_scan_i.h similarity index 100% rename from components/wpa_supplicant/src/esp_supplicant/esp_scan_i.h rename to components/wpa_supplicant/esp_supplicant/src/esp_scan_i.h diff --git a/components/wpa_supplicant/src/esp_supplicant/esp_wifi_driver.h b/components/wpa_supplicant/esp_supplicant/src/esp_wifi_driver.h similarity index 100% rename from components/wpa_supplicant/src/esp_supplicant/esp_wifi_driver.h rename to components/wpa_supplicant/esp_supplicant/src/esp_wifi_driver.h diff --git a/components/wpa_supplicant/src/esp_supplicant/esp_wpa2.c b/components/wpa_supplicant/esp_supplicant/src/esp_wpa2.c similarity index 100% rename from components/wpa_supplicant/src/esp_supplicant/esp_wpa2.c rename to components/wpa_supplicant/esp_supplicant/src/esp_wpa2.c diff --git a/components/wpa_supplicant/src/esp_supplicant/esp_wpa3.c b/components/wpa_supplicant/esp_supplicant/src/esp_wpa3.c similarity index 100% rename from components/wpa_supplicant/src/esp_supplicant/esp_wpa3.c rename to components/wpa_supplicant/esp_supplicant/src/esp_wpa3.c diff --git a/components/wpa_supplicant/src/esp_supplicant/esp_wpa3_i.h b/components/wpa_supplicant/esp_supplicant/src/esp_wpa3_i.h similarity index 100% rename from components/wpa_supplicant/src/esp_supplicant/esp_wpa3_i.h rename to components/wpa_supplicant/esp_supplicant/src/esp_wpa3_i.h diff --git a/components/wpa_supplicant/src/esp_supplicant/esp_wpa_err.h b/components/wpa_supplicant/esp_supplicant/src/esp_wpa_err.h similarity index 100% rename from components/wpa_supplicant/src/esp_supplicant/esp_wpa_err.h rename to components/wpa_supplicant/esp_supplicant/src/esp_wpa_err.h diff --git a/components/wpa_supplicant/src/esp_supplicant/esp_wpa_main.c b/components/wpa_supplicant/esp_supplicant/src/esp_wpa_main.c similarity index 100% rename from components/wpa_supplicant/src/esp_supplicant/esp_wpa_main.c rename to components/wpa_supplicant/esp_supplicant/src/esp_wpa_main.c diff --git a/components/wpa_supplicant/src/esp_supplicant/esp_wpas_glue.c b/components/wpa_supplicant/esp_supplicant/src/esp_wpas_glue.c similarity index 100% rename from components/wpa_supplicant/src/esp_supplicant/esp_wpas_glue.c rename to components/wpa_supplicant/esp_supplicant/src/esp_wpas_glue.c diff --git a/components/wpa_supplicant/src/esp_supplicant/esp_wpas_glue.h b/components/wpa_supplicant/esp_supplicant/src/esp_wpas_glue.h similarity index 100% rename from components/wpa_supplicant/src/esp_supplicant/esp_wpas_glue.h rename to components/wpa_supplicant/esp_supplicant/src/esp_wpas_glue.h diff --git a/components/wpa_supplicant/src/esp_supplicant/esp_wps.c b/components/wpa_supplicant/esp_supplicant/src/esp_wps.c similarity index 100% rename from components/wpa_supplicant/src/esp_supplicant/esp_wps.c rename to components/wpa_supplicant/esp_supplicant/src/esp_wps.c diff --git a/components/wpa_supplicant/src/ap/ap_config.c b/components/wpa_supplicant/src/ap/ap_config.c index 41ef160fc8..840334c771 100644 --- a/components/wpa_supplicant/src/ap/ap_config.c +++ b/components/wpa_supplicant/src/ap/ap_config.c @@ -17,7 +17,7 @@ #include "utils/wpa_debug.h" #include "ap/hostapd.h" #include "ap/wpa_auth_i.h" -#include "esp_supplicant/esp_wifi_driver.h" +#include "esp_wifi_driver.h" #include "esp_wifi_types.h" void hostapd_config_defaults_bss(struct hostapd_bss_config *bss) diff --git a/components/wpa_supplicant/src/ap/wpa_auth.c b/components/wpa_supplicant/src/ap/wpa_auth.c index a76a7e8dce..c3fb9bb5a2 100644 --- a/components/wpa_supplicant/src/ap/wpa_auth.c +++ b/components/wpa_supplicant/src/ap/wpa_auth.c @@ -25,7 +25,7 @@ #include "crypto/sha256.h" #include "crypto/random.h" -#include "esp_supplicant/esp_wifi_driver.h" +#include "esp_wifi_driver.h" #include "esp_wifi.h" #include "esp_private/wifi.h" diff --git a/components/wpa_supplicant/src/common/bss.c b/components/wpa_supplicant/src/common/bss.c index 6b6e199626..559119916e 100644 --- a/components/wpa_supplicant/src/common/bss.c +++ b/components/wpa_supplicant/src/common/bss.c @@ -17,7 +17,7 @@ #include "scan.h" #include "bss.h" #ifdef ESP_SUPPLICANT -#include "esp_supplicant/esp_wifi_driver.h" +#include "esp_wifi_driver.h" #endif #define MAX_BSS_COUNT 20 diff --git a/components/wpa_supplicant/src/common/ieee802_11_common.h b/components/wpa_supplicant/src/common/ieee802_11_common.h index 79c4a24029..fa23faeca5 100644 --- a/components/wpa_supplicant/src/common/ieee802_11_common.h +++ b/components/wpa_supplicant/src/common/ieee802_11_common.h @@ -11,7 +11,7 @@ #include "defs.h" #include "ieee802_11_defs.h" -#include "esp_supplicant/esp_wifi_driver.h" +#include "esp_wifi_driver.h" struct element { u8 id; diff --git a/components/wpa_supplicant/src/common/rrm.c b/components/wpa_supplicant/src/common/rrm.c index ca1c21c17a..e3fcc3cb10 100644 --- a/components/wpa_supplicant/src/common/rrm.c +++ b/components/wpa_supplicant/src/common/rrm.c @@ -17,7 +17,9 @@ #include "rrm.h" #include "scan.h" #include -#include "esp_supplicant/esp_common_i.h" +#ifdef ESP_SUPPLICANT +#include "esp_common_i.h" +#endif static void wpas_rrm_neighbor_rep_timeout_handler(void *data, void *user_ctx) { diff --git a/components/wpa_supplicant/src/common/wpa_common.h b/components/wpa_supplicant/src/common/wpa_common.h index 8d6f94c901..90ca0616e6 100644 --- a/components/wpa_supplicant/src/common/wpa_common.h +++ b/components/wpa_supplicant/src/common/wpa_common.h @@ -13,7 +13,7 @@ */ #include "os.h" -#include "esp_supplicant/esp_wifi_driver.h" +#include "esp_wifi_driver.h" #ifndef WPA_COMMON_H #define WPA_COMMON_H diff --git a/components/wpa_supplicant/src/eap_peer/eap.c b/components/wpa_supplicant/src/eap_peer/eap.c index b71f4c14b3..a2bdf5e1ab 100644 --- a/components/wpa_supplicant/src/eap_peer/eap.c +++ b/components/wpa_supplicant/src/eap_peer/eap.c @@ -35,7 +35,7 @@ #include "eap_peer/eap_config.h" #include "eap_peer/eap.h" #include "eap_peer/eap_tls.h" -#include "esp_supplicant/esp_wifi_driver.h" +#include "esp_wifi_driver.h" #ifdef EAP_PEER_METHOD #include "eap_peer/eap_methods.h" #endif diff --git a/components/wpa_supplicant/src/rsn_supp/wpa.c b/components/wpa_supplicant/src/rsn_supp/wpa.c index be793e4728..2d45c11632 100644 --- a/components/wpa_supplicant/src/rsn_supp/wpa.c +++ b/components/wpa_supplicant/src/rsn_supp/wpa.c @@ -21,8 +21,8 @@ #include "common/eapol_common.h" #include "common/ieee802_11_defs.h" #include "rsn_supp/wpa_ie.h" -#include "esp_supplicant/esp_wpas_glue.h" -#include "esp_supplicant/esp_wifi_driver.h" +#include "esp_wpas_glue.h" +#include "esp_wifi_driver.h" #include "crypto/crypto.h" #include "crypto/sha1.h" diff --git a/components/wpa_supplicant/test/CMakeLists.txt b/components/wpa_supplicant/test/CMakeLists.txt index 39d34fdae5..501618164c 100644 --- a/components/wpa_supplicant/test/CMakeLists.txt +++ b/components/wpa_supplicant/test/CMakeLists.txt @@ -1,12 +1,12 @@ idf_component_register(SRC_DIRS "." PRIV_INCLUDE_DIRS "." "${CMAKE_CURRENT_BINARY_DIR}" - PRIV_INCLUDE_DIRS "../src" + PRIV_INCLUDE_DIRS "../src" "../esp_supplicant/src" PRIV_REQUIRES cmock esp_common test_utils wpa_supplicant mbedtls) idf_component_get_property(esp_supplicant_dir wpa_supplicant COMPONENT_DIR) # Calculate MD5 value of header file esp_wifi_driver.h -file(MD5 ${esp_supplicant_dir}/src/esp_supplicant/esp_wifi_driver.h WIFI_SUPPLICANT_MD5) +file(MD5 ${esp_supplicant_dir}/esp_supplicant/src/esp_wifi_driver.h WIFI_SUPPLICANT_MD5) string(SUBSTRING "${WIFI_SUPPLICANT_MD5}" 0 7 WIFI_SUPPLICANT_MD5) add_definitions(-DWIFI_SUPPLICANT_MD5=\"${WIFI_SUPPLICANT_MD5}\") diff --git a/components/wpa_supplicant/test/test_offchannel.c b/components/wpa_supplicant/test/test_offchannel.c index 853377e96a..72f2723bdc 100644 --- a/components/wpa_supplicant/test/test_offchannel.c +++ b/components/wpa_supplicant/test/test_offchannel.c @@ -20,7 +20,7 @@ #include "esp_wifi_types.h" #include "utils/common.h" #include "common/ieee802_11_defs.h" -#include "../src/esp_supplicant/esp_wifi_driver.h" +#include "../esp_supplicant/src/esp_wifi_driver.h" #include "esp_log.h" #include "test_utils.h" #include "freertos/event_groups.h" diff --git a/tools/ci/check_public_headers_exceptions.txt b/tools/ci/check_public_headers_exceptions.txt index 4917255980..55f9defef4 100644 --- a/tools/ci/check_public_headers_exceptions.txt +++ b/tools/ci/check_public_headers_exceptions.txt @@ -45,6 +45,7 @@ components/bootloader_support/include/esp_app_format.h components/wpa_supplicant/include/ components/wpa_supplicant/port/ +components/wpa_supplicant/esp_supplicant/include/ components/mbedtls/port/include/ components/mbedtls/mbedtls/include/mbedtls/ diff --git a/tools/ci/sonar_exclude_list.txt b/tools/ci/sonar_exclude_list.txt index c3ac06f251..f4f38d69f0 100644 --- a/tools/ci/sonar_exclude_list.txt +++ b/tools/ci/sonar_exclude_list.txt @@ -9,3 +9,7 @@ # FreeRTOS upstream code (don't include our port files here) components/freertos/*.c components/freertos/include/freertos/*.h + +# wpa_supplicant upstream code +components/wpa_supplicant/src/* +components/wpa_supplicant/include/*.h