2727#
2828
2929# Set the mbed TLS release to import (this can/should be edited before import)
30- MBED_TLS_RELEASE ?= mbedtls-2.17.0
31- MBED_TLS_REPO_URL ?= git@github.com:ARMmbed/mbedtls.git
30+ MBED_TLS_RELEASE ?= mbedtls-2.18.0-rc2
31+ MBED_TLS_REPO_URL ?= git@github.com:ARMmbed/mbedtls-restricted .git
3232
3333# Translate between mbed TLS namespace and mbed namespace
3434TARGET_PREFIX: =../
@@ -41,6 +41,67 @@ MBED_TLS_DIR:=TARGET_IGNORE/mbedtls
4141MBED_TLS_API: =$(MBED_TLS_DIR ) /include/mbedtls
4242MBED_TLS_GIT_CFG =$(MBED_TLS_DIR ) /.git/config
4343
44+ CRYPTO_SRC := \
45+ $(TARGET_SRC ) /aes.c \
46+ $(TARGET_SRC ) /aesni.c \
47+ $(TARGET_SRC ) /arc4.c \
48+ $(TARGET_SRC ) /aria.c \
49+ $(TARGET_SRC ) /asn1parse.c \
50+ $(TARGET_SRC ) /asn1write.c \
51+ $(TARGET_SRC ) /base64.c \
52+ $(TARGET_SRC ) /bignum.c \
53+ $(TARGET_SRC ) /blowfish.c \
54+ $(TARGET_SRC ) /camellia.c \
55+ $(TARGET_SRC ) /ccm.c \
56+ $(TARGET_SRC ) /chacha20.c \
57+ $(TARGET_SRC ) /chachapoly.c \
58+ $(TARGET_SRC ) /cipher.c \
59+ $(TARGET_SRC ) /cipher_wrap.c \
60+ $(TARGET_SRC ) /cmac.c \
61+ $(TARGET_SRC ) /ctr_drbg.c \
62+ $(TARGET_SRC ) /des.c \
63+ $(TARGET_SRC ) /dhm.c \
64+ $(TARGET_SRC ) /ecdh.c \
65+ $(TARGET_SRC ) /ecdsa.c \
66+ $(TARGET_SRC ) /ecjpake.c \
67+ $(TARGET_SRC ) /ecp.c \
68+ $(TARGET_SRC ) /ecp_curves.c \
69+ $(TARGET_SRC ) /entropy.c \
70+ $(TARGET_SRC ) /entropy_poll.c \
71+ $(TARGET_SRC ) /gcm.c \
72+ $(TARGET_SRC ) /havege.c \
73+ $(TARGET_SRC ) /hkdf.c \
74+ $(TARGET_SRC ) /hmac_drbg.c \
75+ $(TARGET_SRC ) /md.c \
76+ $(TARGET_SRC ) /md2.c \
77+ $(TARGET_SRC ) /md4.c \
78+ $(TARGET_SRC ) /md5.c \
79+ $(TARGET_SRC ) /md_wrap.c \
80+ $(TARGET_SRC ) /memory_buffer_alloc.c \
81+ $(TARGET_SRC ) /nist_kw.c \
82+ $(TARGET_SRC ) /oid.c \
83+ $(TARGET_SRC ) /padlock.c \
84+ $(TARGET_SRC ) /pem.c \
85+ $(TARGET_SRC ) /pk.c \
86+ $(TARGET_SRC ) /pk_wrap.c \
87+ $(TARGET_SRC ) /pkcs12.c \
88+ $(TARGET_SRC ) /pkcs5.c \
89+ $(TARGET_SRC ) /pkparse.c \
90+ $(TARGET_SRC ) /pkwrite.c \
91+ $(TARGET_SRC ) /platform.c \
92+ $(TARGET_SRC ) /platform_util.c \
93+ $(TARGET_SRC ) /poly1305.c \
94+ $(TARGET_SRC ) /ripemd160.c \
95+ $(TARGET_SRC ) /rsa_internal.c \
96+ $(TARGET_SRC ) /rsa.c \
97+ $(TARGET_SRC ) /sha1.c \
98+ $(TARGET_SRC ) /sha256.c \
99+ $(TARGET_SRC ) /sha512.c \
100+ $(TARGET_SRC ) /threading.c \
101+ $(TARGET_SRC ) /timing.c \
102+ $(TARGET_SRC ) /xtea.c \
103+ # end
104+
44105.PHONY : all deploy deploy-tests rsync mbedtls clean update
45106
46107all : mbedtls
@@ -53,6 +114,9 @@ rsync:
53114 rm -rf $(TARGET_SRC )
54115 rsync -a --exclude=' *.txt' $(MBED_TLS_DIR ) /library/ $(TARGET_SRC )
55116 #
117+ # Remove files that duplicate Mbed Crypto
118+ rm -rf $(CRYPTO_SRC )
119+ #
56120 # Copying mbed TLS headers to mbed includes...
57121 rm -rf $(TARGET_INC )
58122 mkdir -p $(TARGET_INC )
@@ -86,14 +150,16 @@ update: $(MBED_TLS_GIT_CFG) $(MBED_TLS_HA_GIT_CFG)
86150 # Updating to the specified mbed TLS library version
87151 # (If it is not an initial checkout we will start with the repository
88152 # being in a detached head state)
89- git -C $(MBED_TLS_DIR ) checkout development
90- git -C $(MBED_TLS_DIR ) pull --rebase origin development
153+ git -C $(MBED_TLS_DIR ) fetch
91154 #
92155 # Checking out the required release
93156 git -C $(MBED_TLS_DIR ) checkout $(MBED_TLS_RELEASE )
94157 #
158+ # Update and checkout git submodules
159+ git -C $(MBED_TLS_DIR ) submodule update --init --recursive
160+ #
95161 # Updating checked out version tag
96- echo $( MBED_TLS_RELEASE ) > $(TARGET_PREFIX ) VERSION.txt
162+ git -C $( MBED_TLS_DIR ) describe --tags --abbrev=12 --dirty --always > $(TARGET_PREFIX ) VERSION.txt
97163
98164$(MBED_TLS_GIT_CFG ) :
99165 rm -rf $(MBED_TLS_DIR )
0 commit comments