esp-idf/components/wpa_supplicant/component.mk
kapil.gupta ae35d70359 wpa_supplicant: Write Crypto API based on mbedtls
This commit add following crypto changes

1. Update current crypto code with upstream supplicant code
2. Add a proper porting layer to use mbedtls APIs for all the crypto
   operations used by supplicant.

Internal crypto will be used when USE_MBEDLTS flag is disabled
in supplicant's menuconfig.

This commit also removes the clutter in crypto files due to partial
porting of some APIs to mbedtls, all the code from those files have
been removed and rewritten in a generic way, this is inspired from
current upstream code.

This also reduces the lib size significantly, supplicant's lib
size reduces around ~567kb after this change(NB: lib size doesn't
indicate reduction in final bin size).
2021-06-29 14:34:48 +08:00

82 lines
2.7 KiB
Makefile

# 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
ifeq ($(CONFIG_WPA_MBEDTLS_CRYPTO), y)
COMPONENT_OBJEXCLUDE += src/tls/asn1.o \
src/tls/bignum.o \
src/tls/pkcs1.o \
src/tls/pkcs5.o \
src/tls/pkcs8.o \
src/tls/rsa.o \
src/tls/tls_internal.o \
src/tls/tlsv1_client.o \
src/tls/tlsv1_client_read.o \
src/tls/tlsv1_client_write.o \
src/tls/tlsv1_common.o \
src/tls/tlsv1_cred.o \
src/tls/tlsv1_record.o \
src/tls/tlsv1_server.o \
src/tls/tlsv1_server_read.o \
src/tls/tlsv1_server_write.o \
src/tls/x509v3.o \
src/crypto/aes-ctr.o \
src/crypto/aes-cbc.o \
src/crypto/aes-internal-dec.o \
src/crypto/aes-internal-enc.o \
src/crypto/aes-internal.o \
src/crypto/crypto_internal-cipher.o \
src/crypto/crypto_internal-modexp.o \
src/crypto/crypto_internal-rsa.o \
src/crypto/crypto_mbedtls-rsa.o \
src/crypto/crypto_internal.o \
src/crypto/md5-internal.o \
src/crypto/md5.o \
src/crypto/sha1-internal.o \
src/crypto/sha1-pbkdf2.o \
src/crypto/sha1.o \
src/crypto/sha256-internal.o \
src/crypto/sha256.o
else
COMPONENT_OBJEXCLUDE += src/crypto/tls_mbedtls.o \
src/crypto/crypto_mbedtls.o \
src/crypto/crypto_mbedtls-bignum.o \
src/crypto/crypto_mbedtls-ec.o
endif
ifneq ($(CONFIG_MBEDTLS_RC4_DISABLED), y)
COMPONENT_OBJEXCLUDE += src/crypto/rc4.o
endif
ifeq ($(CONFIG_MBEDTLS_DES_C), y)
COMPONENT_OBJEXCLUDE += src/crypto/des-internal.o
endif
ifeq ($(CONFIG_MBEDTLS_CMAC_C), y)
COMPONENT_OBJEXCLUDE += src/crypto/aes-omac1.o
endif
ifeq ($(CONFIG_MBEDTLS_NIST_KW_C), y)
COMPONENT_OBJEXCLUDE += src/crypto/aes-wrap.o
COMPONENT_OBJEXCLUDE += src/crypto/aes-unwrap.o
COMPONENT_OBJEXCLUDE += src/crypto/aes-ccm.o
endif
ifneq ($(CONFIG_WPA_11KV_SUPPORT), y)
COMPONENT_OBJEXCLUDE += src/common/rrm.o \
src/common/wnm_sta.o \
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
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
endif
ifdef CONFIG_WPA_WPS_STRICT
CFLAGS += -DCONFIG_WPS_STRICT
endif