diff --git a/components/wpa_supplicant/CMakeLists.txt b/components/wpa_supplicant/CMakeLists.txt index 9a47093364..b5b04cf36f 100644 --- a/components/wpa_supplicant/CMakeLists.txt +++ b/components/wpa_supplicant/CMakeLists.txt @@ -5,7 +5,6 @@ set(srcs "port/os_xtensa.c" "src/ap/wpa_auth_ie.c" "src/common/sae.c" "src/common/wpa_common.c" - "src/common/dpp.c" "src/utils/bitfield.c" "src/crypto/aes-siv.c" "src/crypto/sha256-kdf.c" @@ -158,7 +157,14 @@ else() set(roaming_src "") endif() -idf_component_register(SRCS "${srcs}" "${tls_src}" "${roaming_src}" "${crypto_src}" +if(CONFIG_WPA_DPP_SUPPORT) + set(dpp_src "src/common/dpp.c" + "esp_supplicant/src/esp_dpp.c") +else() + set(dpp_src "") +endif() + +idf_component_register(SRCS "${srcs}" "${tls_src}" "${roaming_src}" "${crypto_src}" "${dpp_src}" INCLUDE_DIRS include port/include include/esp_supplicant PRIV_INCLUDE_DIRS src src/utils PRIV_REQUIRES mbedtls esp_timer) @@ -183,7 +189,6 @@ target_compile_definitions(${COMPONENT_LIB} PRIVATE CONFIG_ECC CONFIG_IEEE80211W CONFIG_SHA256 - CONFIG_DPP CONFIG_WNM ) @@ -193,5 +198,7 @@ endif() if(CONFIG_WPA_WPS_STRICT) target_compile_definitions(${COMPONENT_LIB} PRIVATE CONFIG_WPS_STRICT) endif() - +if(CONFIG_WPA_DPP_SUPPORT) + target_compile_definitions(${COMPONENT_LIB} PRIVATE CONFIG_DPP) +endif() set_property(TARGET ${COMPONENT_LIB} APPEND PROPERTY LINK_INTERFACE_MULTIPLICITY 3) diff --git a/components/wpa_supplicant/Kconfig b/components/wpa_supplicant/Kconfig index c98b38bcaa..d612997308 100644 --- a/components/wpa_supplicant/Kconfig +++ b/components/wpa_supplicant/Kconfig @@ -38,8 +38,8 @@ menu "Supplicant" rigorously. Disabling this add the workaorunds with various APs. Enabling this may cause inter operability issues with some APs. - menuconfig WPA_11KV_SUPPORT - bool "Enable 802.11k, 802.11v APIs handling in supplicant" + config WPA_11KV_SUPPORT + bool "Enable 802.11k, 802.11v APIs handling" default n help Select this option to enable 802.11k 802.11v APIs(RRM and BTM support). @@ -54,12 +54,19 @@ menu "Supplicant" and on the radio environment. Current implementation adds beacon report, link measurement, neighbor report. - if WPA_11KV_SUPPORT - config WPA_SCAN_CACHE - bool "Keep scan results in cache" - default n - help - Keep scan results in cache, if not enabled, those - will be flushed immediately. - endif + config WPA_SCAN_CACHE + bool "Keep scan results in cache" + depends on WPA_11KV_SUPPORT + default n + help + Keep scan results in cache, if not enabled, those + will be flushed immediately. + + config WPA_DPP_SUPPORT + bool "Enable DPP support" + default n + select WPA_MBEDTLS_CRYPTO + help + Select this option to enable WiFi Easy Connect Support. + endmenu diff --git a/components/wpa_supplicant/include/esp_supplicant/esp_dpp.h b/components/wpa_supplicant/include/esp_supplicant/esp_dpp.h index c6c86bc536..d1bb43a0ad 100644 --- a/components/wpa_supplicant/include/esp_supplicant/esp_dpp.h +++ b/components/wpa_supplicant/include/esp_supplicant/esp_dpp.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef ESP_DPP_H #define ESP_DPP_H diff --git a/components/wpa_supplicant/src/esp_supplicant/esp_dpp.c b/components/wpa_supplicant/src/esp_supplicant/esp_dpp.c index 1dcdf6688e..06d764b0ea 100644 --- a/components/wpa_supplicant/src/esp_supplicant/esp_dpp.c +++ b/components/wpa_supplicant/src/esp_supplicant/esp_dpp.c @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #include "esp_dpp_i.h" #include "esp_dpp.h" @@ -20,6 +12,7 @@ #include "esp_wifi.h" #include "common/ieee802_11_defs.h" +#ifdef CONFIG_DPP static void *s_dpp_task_hdl = NULL; static void *s_dpp_evt_queue = NULL; static void *s_dpp_api_lock = NULL; @@ -676,3 +669,4 @@ void esp_supp_dpp_deinit(void) dpp_global_deinit(s_dpp_ctx.dpp_global); esp_dpp_post_evt(SIG_DPP_DEL_TASK, 0); } +#endif diff --git a/examples/wifi/wifi_easy_connect/dpp-enrollee/sdkconfig.defaults b/examples/wifi/wifi_easy_connect/dpp-enrollee/sdkconfig.defaults new file mode 100644 index 0000000000..e67b04732c --- /dev/null +++ b/examples/wifi/wifi_easy_connect/dpp-enrollee/sdkconfig.defaults @@ -0,0 +1 @@ +CONFIG_WPA_DPP_SUPPORT=y