diff --git a/features/mbedtls/importer/Makefile b/features/mbedtls/importer/Makefile index fe79056685..364f7ac553 100644 --- a/features/mbedtls/importer/Makefile +++ b/features/mbedtls/importer/Makefile @@ -41,6 +41,67 @@ MBED_TLS_DIR:=TARGET_IGNORE/mbedtls MBED_TLS_API:=$(MBED_TLS_DIR)/include/mbedtls MBED_TLS_GIT_CFG=$(MBED_TLS_DIR)/.git/config +CRYPTO_SRC := \ + $(TARGET_SRC)/aes.c \ + $(TARGET_SRC)/aesni.c \ + $(TARGET_SRC)/arc4.c \ + $(TARGET_SRC)/aria.c \ + $(TARGET_SRC)/asn1parse.c \ + $(TARGET_SRC)/asn1write.c \ + $(TARGET_SRC)/base64.c \ + $(TARGET_SRC)/bignum.c \ + $(TARGET_SRC)/blowfish.c \ + $(TARGET_SRC)/camellia.c \ + $(TARGET_SRC)/ccm.c \ + $(TARGET_SRC)/chacha20.c \ + $(TARGET_SRC)/chachapoly.c \ + $(TARGET_SRC)/cipher.c \ + $(TARGET_SRC)/cipher_wrap.c \ + $(TARGET_SRC)/cmac.c \ + $(TARGET_SRC)/ctr_drbg.c \ + $(TARGET_SRC)/des.c \ + $(TARGET_SRC)/dhm.c \ + $(TARGET_SRC)/ecdh.c \ + $(TARGET_SRC)/ecdsa.c \ + $(TARGET_SRC)/ecjpake.c \ + $(TARGET_SRC)/ecp.c \ + $(TARGET_SRC)/ecp_curves.c \ + $(TARGET_SRC)/entropy.c \ + $(TARGET_SRC)/entropy_poll.c \ + $(TARGET_SRC)/gcm.c \ + $(TARGET_SRC)/havege.c \ + $(TARGET_SRC)/hkdf.c \ + $(TARGET_SRC)/hmac_drbg.c \ + $(TARGET_SRC)/md.c \ + $(TARGET_SRC)/md2.c \ + $(TARGET_SRC)/md4.c \ + $(TARGET_SRC)/md5.c \ + $(TARGET_SRC)/md_wrap.c \ + $(TARGET_SRC)/memory_buffer_alloc.c \ + $(TARGET_SRC)/nist_kw.c \ + $(TARGET_SRC)/oid.c \ + $(TARGET_SRC)/padlock.c \ + $(TARGET_SRC)/pem.c \ + $(TARGET_SRC)/pk.c \ + $(TARGET_SRC)/pk_wrap.c \ + $(TARGET_SRC)/pkcs12.c \ + $(TARGET_SRC)/pkcs5.c \ + $(TARGET_SRC)/pkparse.c \ + $(TARGET_SRC)/pkwrite.c \ + $(TARGET_SRC)/platform.c \ + $(TARGET_SRC)/platform_util.c \ + $(TARGET_SRC)/poly1305.c \ + $(TARGET_SRC)/ripemd160.c \ + $(TARGET_SRC)/rsa_internal.c \ + $(TARGET_SRC)/rsa.c \ + $(TARGET_SRC)/sha1.c \ + $(TARGET_SRC)/sha256.c \ + $(TARGET_SRC)/sha512.c \ + $(TARGET_SRC)/threading.c \ + $(TARGET_SRC)/timing.c \ + $(TARGET_SRC)/xtea.c \ + # end + .PHONY: all deploy deploy-tests rsync mbedtls clean update all: mbedtls @@ -53,6 +114,9 @@ rsync: rm -rf $(TARGET_SRC) rsync -a --exclude='*.txt' $(MBED_TLS_DIR)/library/ $(TARGET_SRC) # + # Remove files that duplicate Mbed Crypto + rm -rf $(CRYPTO_SRC) + # # Copying mbed TLS headers to mbed includes... rm -rf $(TARGET_INC) mkdir -p $(TARGET_INC) diff --git a/features/mbedtls/mbed-crypto/importer/Makefile b/features/mbedtls/mbed-crypto/importer/Makefile index 0dbba7e0fd..5bc9842507 100644 --- a/features/mbedtls/mbed-crypto/importer/Makefile +++ b/features/mbedtls/mbed-crypto/importer/Makefile @@ -35,6 +35,13 @@ CRYPTO_REPO_URL ?= git@github.com:ARMmbed/mbed-crypto.git # Translate between Mbed Crypto namespace and Mbed OS namespace TARGET_PREFIX:=.. TARGET_INC:=$(TARGET_PREFIX)/inc +TARGET_SRC:=$(TARGET_PREFIX)/src + +TLS_SRC := \ + $(TARGET_SRC)/error.c \ + $(TARGET_SRC)/version.c \ + $(TARGET_SRC)/version_features.c \ + # end # A folder structure is introduced here for targets that have both a Secure # Processing Environment (SPE) targets and Non-secure Processing Environment @@ -82,6 +89,13 @@ rsync: rsync -a --delete $(CRYPTO_API)/crypto_struct.h $(TARGET_SPE)/crypto_struct_spe.h rsync -a --delete $(CRYPTO_DIR)/library/psa_*.c $(TARGET_SRV_IMPL)/ rsync -a --delete $(CRYPTO_DIR)/library/psa_*.h $(TARGET_SRV_IMPL)/ + rsync -a --delete $(CRYPTO_DIR)/library/*.c $(TARGET_SRC)/ + # + # Remove PSA-specific C files (they go into $(TARGET_SRV_IMPL)) + rm -rf $(TARGET_SRC)/psa_*.c + # + # Remove files that duplicate Mbed TLS + rm -rf $(TLS_SRC) update: $(CRYPTO_GIT_CFG) # @@ -109,6 +123,7 @@ clean: rm -f $(TARGET_PREFIX)/VERSION.txt rm -f $(TARGET_PREFIX)/AUTHORS.txt rm -rf $(TARGET_INC) + rm -rf $(TARGET_SRC) rm -rf $(CRYPTO_DIR) rm -rf $(TARGET_SRV_IMPL) rm -rf $(TARGET_SPE)