2018-08-13 04:37:56 -04:00
|
|
|
set(srcs "port/os_xtensa.c"
|
2022-03-09 11:40:36 -05:00
|
|
|
"port/eloop.c"
|
2018-08-13 04:37:56 -04:00
|
|
|
"src/ap/ap_config.c"
|
|
|
|
"src/ap/ieee802_1x.c"
|
|
|
|
"src/ap/wpa_auth.c"
|
|
|
|
"src/ap/wpa_auth_ie.c"
|
2022-05-13 04:02:24 -04:00
|
|
|
"src/ap/sta_info.c"
|
2019-11-11 06:20:04 -05:00
|
|
|
"src/common/sae.c"
|
2018-08-13 04:37:56 -04:00
|
|
|
"src/common/wpa_common.c"
|
2020-11-12 03:18:24 -05:00
|
|
|
"src/utils/bitfield.c"
|
2020-04-13 12:25:52 -04:00
|
|
|
"src/crypto/aes-siv.c"
|
|
|
|
"src/crypto/sha256-kdf.c"
|
2019-11-12 01:09:49 -05:00
|
|
|
"src/crypto/ccmp.c"
|
2021-10-09 12:34:55 -04:00
|
|
|
"src/crypto/aes-gcm.c"
|
2019-08-06 07:40:16 -04:00
|
|
|
"src/crypto/crypto_ops.c"
|
2019-06-21 02:29:32 -04:00
|
|
|
"src/crypto/dh_group5.c"
|
|
|
|
"src/crypto/dh_groups.c"
|
|
|
|
"src/crypto/ms_funcs.c"
|
2020-05-28 11:54:56 -04:00
|
|
|
"src/crypto/sha1-tlsprf.c"
|
|
|
|
"src/crypto/sha256-tlsprf.c"
|
|
|
|
"src/crypto/sha384-tlsprf.c"
|
|
|
|
"src/crypto/sha256-prf.c"
|
2020-09-14 04:21:25 -04:00
|
|
|
"src/crypto/sha1-prf.c"
|
2021-10-09 12:34:55 -04:00
|
|
|
"src/crypto/sha384-prf.c"
|
2020-09-14 04:21:25 -04:00
|
|
|
"src/crypto/md4-internal.c"
|
2021-08-30 06:12:32 -04:00
|
|
|
"src/crypto/sha1-tprf.c"
|
2021-12-17 03:50:51 -05:00
|
|
|
"src/eap_common/eap_wsc_common.c"
|
2022-05-13 04:02:24 -04:00
|
|
|
"src/common/ieee802_11_common.c"
|
2018-08-13 04:37:56 -04:00
|
|
|
"src/eap_peer/chap.c"
|
|
|
|
"src/eap_peer/eap.c"
|
|
|
|
"src/eap_peer/eap_common.c"
|
|
|
|
"src/eap_peer/eap_mschapv2.c"
|
|
|
|
"src/eap_peer/eap_peap.c"
|
|
|
|
"src/eap_peer/eap_peap_common.c"
|
|
|
|
"src/eap_peer/eap_tls.c"
|
|
|
|
"src/eap_peer/eap_tls_common.c"
|
|
|
|
"src/eap_peer/eap_ttls.c"
|
|
|
|
"src/eap_peer/mschapv2.c"
|
2021-08-30 06:12:32 -04:00
|
|
|
"src/eap_peer/eap_fast.c"
|
|
|
|
"src/eap_peer/eap_fast_common.c"
|
|
|
|
"src/eap_peer/eap_fast_pac.c"
|
2019-09-19 07:23:56 -04:00
|
|
|
"src/rsn_supp/pmksa_cache.c"
|
2018-08-13 04:37:56 -04:00
|
|
|
"src/rsn_supp/wpa.c"
|
|
|
|
"src/rsn_supp/wpa_ie.c"
|
2020-05-28 11:54:56 -04:00
|
|
|
"src/utils/base64.c"
|
|
|
|
"src/utils/common.c"
|
|
|
|
"src/utils/ext_password.c"
|
|
|
|
"src/utils/uuid.c"
|
|
|
|
"src/utils/wpabuf.c"
|
|
|
|
"src/utils/wpa_debug.c"
|
|
|
|
"src/utils/json.c"
|
|
|
|
"src/wps/wps.c"
|
|
|
|
"src/wps/wps_attr_build.c"
|
|
|
|
"src/wps/wps_attr_parse.c"
|
|
|
|
"src/wps/wps_attr_process.c"
|
|
|
|
"src/wps/wps_common.c"
|
|
|
|
"src/wps/wps_dev_attr.c"
|
2021-12-17 03:50:51 -05:00
|
|
|
"src/wps/wps_enrollee.c")
|
2020-05-28 11:54:56 -04:00
|
|
|
|
2021-04-07 03:04:51 -04:00
|
|
|
set(esp_srcs "esp_supplicant/src/esp_wpa2.c"
|
2021-05-07 06:16:41 -04:00
|
|
|
"esp_supplicant/src/esp_wpa_main.c"
|
|
|
|
"esp_supplicant/src/esp_wpas_glue.c"
|
2020-07-27 05:11:40 -04:00
|
|
|
"esp_supplicant/src/esp_common.c"
|
2021-05-07 06:16:41 -04:00
|
|
|
"esp_supplicant/src/esp_wps.c"
|
2022-06-14 02:01:52 -04:00
|
|
|
"esp_supplicant/src/esp_wpa3.c"
|
|
|
|
"esp_supplicant/src/esp_owe.c")
|
2021-04-07 03:04:51 -04:00
|
|
|
if(CONFIG_ESP_WIFI_SOFTAP_SUPPORT)
|
|
|
|
set(esp_srcs ${esp_srcs} "esp_supplicant/src/esp_hostap.c")
|
|
|
|
endif()
|
2021-05-07 06:16:41 -04:00
|
|
|
|
2022-05-13 00:57:47 -04:00
|
|
|
if(CONFIG_WPA_MBEDTLS_TLS_CLIENT)
|
2021-12-17 03:50:51 -05:00
|
|
|
set(tls_src "esp_supplicant/src/crypto/tls_mbedtls.c")
|
2020-05-28 11:54:56 -04:00
|
|
|
else()
|
|
|
|
set(tls_src
|
2018-08-13 04:37:56 -04:00
|
|
|
"src/tls/asn1.c"
|
|
|
|
"src/tls/bignum.c"
|
|
|
|
"src/tls/pkcs1.c"
|
|
|
|
"src/tls/pkcs5.c"
|
|
|
|
"src/tls/pkcs8.c"
|
2020-09-14 04:21:25 -04:00
|
|
|
"src/tls/bignum.c"
|
2018-08-13 04:37:56 -04:00
|
|
|
"src/tls/rsa.c"
|
2022-05-13 00:57:47 -04:00
|
|
|
"src/crypto/tls_internal.c"
|
2018-08-13 04:37:56 -04:00
|
|
|
"src/tls/tlsv1_client.c"
|
|
|
|
"src/tls/tlsv1_client_read.c"
|
|
|
|
"src/tls/tlsv1_client_write.c"
|
|
|
|
"src/tls/tlsv1_common.c"
|
|
|
|
"src/tls/tlsv1_cred.c"
|
|
|
|
"src/tls/tlsv1_record.c"
|
2022-05-13 00:57:47 -04:00
|
|
|
"src/tls/tlsv1_client_ocsp.c"
|
2020-09-14 04:21:25 -04:00
|
|
|
"src/tls/x509v3.c")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CONFIG_WPA_MBEDTLS_CRYPTO)
|
|
|
|
set(crypto_src
|
2021-12-17 03:50:51 -05:00
|
|
|
"esp_supplicant/src/crypto/crypto_mbedtls.c"
|
|
|
|
"esp_supplicant/src/crypto/crypto_mbedtls-bignum.c"
|
2022-05-13 00:57:47 -04:00
|
|
|
"esp_supplicant/src/crypto/crypto_mbedtls-rsa.c"
|
2021-12-17 03:50:51 -05:00
|
|
|
"esp_supplicant/src/crypto/crypto_mbedtls-ec.c")
|
2022-05-04 08:38:54 -04:00
|
|
|
# Add internal RC4 as RC4 has been removed from mbedtls
|
|
|
|
set(crypto_src ${crypto_src} "src/crypto/rc4.c")
|
2020-09-14 04:21:25 -04:00
|
|
|
if(NOT CONFIG_MBEDTLS_DES_C)
|
|
|
|
set(crypto_src ${crypto_src} "src/crypto/des-internal.c")
|
|
|
|
endif()
|
|
|
|
# Enabling this only for WiFi is probably not a good idea since MbedTLS
|
|
|
|
# uses generic crypto init/update functions for this. That causes
|
|
|
|
# binary size increment since all the other enabled module
|
|
|
|
# functions will also linked in. Even after not using direct MbedTLS APIs
|
|
|
|
# for these, these API are still faster since these all will be using
|
|
|
|
# AES APIs which is using hardware AES blocks.
|
|
|
|
if(NOT CONFIG_MBEDTLS_CMAC_C)
|
|
|
|
set(crypto_src ${crypto_src} "src/crypto/aes-omac1.c")
|
|
|
|
endif()
|
|
|
|
if(NOT CONFIG_MBEDTLS_NIST_KW_C)
|
|
|
|
set(crypto_src ${crypto_src}
|
|
|
|
"src/crypto/aes-wrap.c"
|
|
|
|
"src/crypto/aes-unwrap.c")
|
|
|
|
endif()
|
|
|
|
if(NOT CONFIG_MBEDTLS_NIST_KW_C OR NOT CONFIG_MBEDTLS_CMAC_C OR NOT CONFIG_MBEDTLS_CCM_C)
|
|
|
|
set(crypto_src ${crypto_src} "src/crypto/aes-ccm.c")
|
|
|
|
endif()
|
|
|
|
else()
|
|
|
|
set(crypto_src
|
|
|
|
"src/crypto/rc4.c"
|
|
|
|
"src/crypto/aes-ctr.c"
|
|
|
|
"src/crypto/aes-cbc.c"
|
|
|
|
"src/crypto/aes-ccm.c"
|
|
|
|
"src/crypto/aes-internal-dec.c"
|
|
|
|
"src/crypto/aes-internal-enc.c"
|
|
|
|
"src/crypto/aes-internal.c"
|
|
|
|
"src/crypto/aes-omac1.c"
|
|
|
|
"src/crypto/aes-unwrap.c"
|
|
|
|
"src/crypto/aes-wrap.c"
|
|
|
|
"src/crypto/crypto_internal-cipher.c"
|
|
|
|
"src/crypto/crypto_internal-modexp.c"
|
|
|
|
"src/crypto/crypto_internal-rsa.c"
|
|
|
|
"src/crypto/crypto_internal.c"
|
|
|
|
"src/crypto/des-internal.c"
|
|
|
|
"src/crypto/md4-internal.c"
|
|
|
|
"src/crypto/md5-internal.c"
|
|
|
|
"src/crypto/md5.c"
|
|
|
|
"src/crypto/sha1-internal.c"
|
|
|
|
"src/crypto/sha1-pbkdf2.c"
|
|
|
|
"src/crypto/sha1.c"
|
|
|
|
"src/crypto/sha256-internal.c"
|
2022-06-14 02:01:52 -04:00
|
|
|
"src/crypto/sha256.c"
|
2021-09-08 04:18:37 -04:00
|
|
|
"src/crypto/sha384-internal.c"
|
|
|
|
"src/crypto/sha512-internal.c"
|
2020-09-14 04:21:25 -04:00
|
|
|
"src/crypto/sha256.c")
|
2020-05-28 11:54:56 -04:00
|
|
|
endif()
|
2018-01-11 21:49:13 -05:00
|
|
|
|
2020-07-27 05:11:40 -04:00
|
|
|
if(CONFIG_WPA_11KV_SUPPORT OR CONFIG_WPA_11R_SUPPORT)
|
2020-11-12 03:18:24 -05:00
|
|
|
set(roaming_src
|
|
|
|
"src/common/bss.c"
|
|
|
|
"src/common/scan.c"
|
|
|
|
"src/common/ieee802_11_common.c"
|
2020-07-27 05:11:40 -04:00
|
|
|
"esp_supplicant/src/esp_scan.c")
|
|
|
|
if(CONFIG_WPA_11KV_SUPPORT)
|
|
|
|
set(roaming_src ${roaming_src} "src/common/rrm.c" "src/common/wnm_sta.c")
|
|
|
|
endif()
|
|
|
|
if(CONFIG_WPA_11R_SUPPORT)
|
|
|
|
set(roaming_src ${roaming_src} "src/rsn_supp/wpa_ft.c")
|
|
|
|
endif()
|
2020-11-12 03:18:24 -05:00
|
|
|
else()
|
|
|
|
set(roaming_src "")
|
|
|
|
endif()
|
2022-01-04 01:04:06 -05:00
|
|
|
|
2021-09-29 01:07:59 -04:00
|
|
|
if(CONFIG_WPA_MBO_SUPPORT)
|
|
|
|
set(mbo_src "src/common/mbo.c")
|
|
|
|
else()
|
|
|
|
set(mbo_src "")
|
|
|
|
endif()
|
2020-11-12 03:18:24 -05:00
|
|
|
|
2022-01-04 01:04:06 -05:00
|
|
|
if(CONFIG_WPA_DPP_SUPPORT)
|
|
|
|
set(dpp_src "src/common/dpp.c"
|
|
|
|
"esp_supplicant/src/esp_dpp.c")
|
|
|
|
else()
|
|
|
|
set(dpp_src "")
|
|
|
|
endif()
|
|
|
|
|
2022-05-13 04:02:24 -04:00
|
|
|
if(CONFIG_WPA_WPS_SOFTAP_REGISTRAR)
|
|
|
|
set(wps_registrar_src
|
|
|
|
"src/ap/wps_hostapd.c"
|
|
|
|
"src/eap_server/eap_server.c"
|
|
|
|
"src/eap_server/eap_server_methods.c"
|
|
|
|
"src/eap_server/eap_server_wsc.c"
|
|
|
|
"src/ap/eap_user_db.c"
|
|
|
|
"src/eapol_auth/eapol_auth_sm.c"
|
|
|
|
"src/eap_server/eap_server_identity.c"
|
|
|
|
"esp_supplicant/src/esp_hostpad_wps.c"
|
|
|
|
"src/wps/wps_registrar.c")
|
|
|
|
else()
|
|
|
|
set(wps_registrar_src "")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
idf_component_register(SRCS "${srcs}" "${esp_srcs}" "${tls_src}" "${roaming_src}"
|
|
|
|
"${crypto_src}" "${mbo_src}" "${dpp_src}" "${wps_registrar_src}"
|
2021-05-07 06:16:41 -04:00
|
|
|
INCLUDE_DIRS include port/include esp_supplicant/include
|
2021-12-17 03:50:51 -05:00
|
|
|
PRIV_INCLUDE_DIRS src src/utils esp_supplicant/src src/crypto
|
2020-02-06 01:00:18 -05:00
|
|
|
PRIV_REQUIRES mbedtls esp_timer)
|
2018-01-11 21:49:13 -05:00
|
|
|
|
2020-07-27 05:11:40 -04:00
|
|
|
target_compile_options(${COMPONENT_LIB} PRIVATE -Wno-strict-aliasing -Wno-write-strings -Werror)
|
2019-05-09 22:53:08 -04:00
|
|
|
target_compile_definitions(${COMPONENT_LIB} PRIVATE
|
2018-05-30 03:41:35 -04:00
|
|
|
__ets__
|
2018-08-13 04:37:56 -04:00
|
|
|
ESP_SUPPLICANT
|
2018-05-30 03:41:35 -04:00
|
|
|
IEEE8021X_EAPOL
|
|
|
|
EAP_PEER_METHOD
|
|
|
|
EAP_MSCHAPv2
|
|
|
|
EAP_TTLS
|
|
|
|
EAP_TLS
|
|
|
|
EAP_PEAP
|
|
|
|
USE_WPA2_TASK
|
2022-05-13 04:02:24 -04:00
|
|
|
CONFIG_WPS
|
2018-05-30 03:41:35 -04:00
|
|
|
USE_WPS_TASK
|
|
|
|
ESPRESSIF_USE
|
|
|
|
ESP32_WORKAROUND
|
2018-08-31 09:55:48 -04:00
|
|
|
CONFIG_ECC
|
2019-11-12 01:05:08 -05:00
|
|
|
CONFIG_IEEE80211W
|
2020-03-27 14:25:21 -04:00
|
|
|
CONFIG_SHA256
|
2022-05-13 04:02:24 -04:00
|
|
|
CONFIG_NO_RADIUS
|
2018-05-30 03:41:35 -04:00
|
|
|
)
|
2020-10-13 03:24:30 -04:00
|
|
|
|
2020-11-20 08:48:54 -05:00
|
|
|
if(CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE)
|
|
|
|
target_compile_definitions(${COMPONENT_LIB} PRIVATE CONFIG_WPA3_SAE)
|
|
|
|
endif()
|
2021-05-13 05:46:26 -04:00
|
|
|
if(CONFIG_WPA_WPS_STRICT)
|
|
|
|
target_compile_definitions(${COMPONENT_LIB} PRIVATE CONFIG_WPS_STRICT)
|
|
|
|
endif()
|
2021-10-09 12:34:55 -04:00
|
|
|
if(CONFIG_WPA_SUITE_B_192)
|
|
|
|
target_compile_definitions(${COMPONENT_LIB} PRIVATE CONFIG_SUITEB192)
|
|
|
|
endif()
|
|
|
|
if(CONFIG_WPA_SUITE_B)
|
|
|
|
target_compile_definitions(${COMPONENT_LIB} PRIVATE CONFIG_SUITEB)
|
|
|
|
endif()
|
|
|
|
if(CONFIG_ESP_WIFI_GCMP_SUPPORT)
|
|
|
|
target_compile_definitions(${COMPONENT_LIB} PRIVATE CONFIG_GCMP)
|
|
|
|
endif()
|
|
|
|
if(CONFIG_ESP_WIFI_GMAC_SUPPORT)
|
|
|
|
target_compile_definitions(${COMPONENT_LIB} PRIVATE CONFIG_GMAC)
|
|
|
|
endif()
|
2021-09-29 01:07:59 -04:00
|
|
|
if(CONFIG_WPA_MBO_SUPPORT)
|
|
|
|
target_compile_definitions(${COMPONENT_LIB} PRIVATE CONFIG_MBO)
|
|
|
|
endif()
|
2022-01-04 01:04:06 -05:00
|
|
|
if(CONFIG_WPA_DPP_SUPPORT)
|
|
|
|
target_compile_definitions(${COMPONENT_LIB} PRIVATE CONFIG_DPP)
|
|
|
|
endif()
|
2020-07-27 05:11:40 -04:00
|
|
|
if(CONFIG_WPA_11KV_SUPPORT)
|
|
|
|
target_compile_definitions(${COMPONENT_LIB} PRIVATE CONFIG_SUPPLICANT_TASK CONFIG_WNM CONFIG_RRM)
|
|
|
|
endif()
|
|
|
|
if(CONFIG_WPA_11R_SUPPORT)
|
|
|
|
target_compile_definitions(${COMPONENT_LIB} PRIVATE CONFIG_IEEE80211R)
|
|
|
|
endif()
|
2022-05-13 00:57:47 -04:00
|
|
|
if(NOT CONFIG_WPA_MBEDTLS_TLS_CLIENT)
|
|
|
|
target_compile_definitions(${COMPONENT_LIB} PRIVATE CONFIG_TLS_INTERNAL_CLIENT
|
|
|
|
CONFIG_TLSV11 CONFIG_TLSV12 CONFIG_INTERNAL_SHA384 CONFIG_INTERNAL_SHA512 EAP_FAST)
|
|
|
|
endif()
|
|
|
|
if(CONFIG_WPA_MBEDTLS_CRYPTO)
|
|
|
|
target_compile_definitions(${COMPONENT_LIB} PRIVATE CONFIG_CRYPTO_MBEDTLS)
|
|
|
|
else()
|
|
|
|
target_compile_definitions(${COMPONENT_LIB} PRIVATE CONFIG_CRYPTO_INTERNAL)
|
|
|
|
endif()
|
2022-05-13 04:02:24 -04:00
|
|
|
if(CONFIG_WPA_WPS_SOFTAP_REGISTRAR)
|
|
|
|
target_compile_definitions(${COMPONENT_LIB} PRIVATE CONFIG_WPS_REGISTRAR)
|
|
|
|
endif()
|
2022-06-14 02:01:52 -04:00
|
|
|
if(CONFIG_ESP32_WIFI_ENABLE_WPA3_OWE_STA)
|
|
|
|
target_compile_definitions(${COMPONENT_LIB} PRIVATE CONFIG_OWE_STA)
|
|
|
|
endif()
|
2020-10-13 03:24:30 -04:00
|
|
|
set_property(TARGET ${COMPONENT_LIB} APPEND PROPERTY LINK_INTERFACE_MULTIPLICITY 3)
|