wpa_supplicant: bypass sonar checks for upstream code

This commit is contained in:
Kapil Gupta 2021-05-07 15:46:41 +05:30 committed by bot
parent 69650e0c18
commit e667d1af2e
41 changed files with 99 additions and 42 deletions

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -0,0 +1,41 @@
wpa_supplicant and hostapd
--------------------------
Copyright (c) 2002-2019, Jouni Malinen <j@w1.fi> 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.

View File

@ -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.)

View File

@ -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

View File

@ -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"

View File

@ -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;

View File

@ -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)

View File

@ -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"

View File

@ -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

View File

@ -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;

View File

@ -17,7 +17,9 @@
#include "rrm.h"
#include "scan.h"
#include <sys/errno.h>
#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)
{

View File

@ -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

View File

@ -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

View File

@ -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"

View File

@ -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}\")

View File

@ -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"

View File

@ -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/

View File

@ -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