8000 extmod/extmod.mk: Integrate mbedTLS so it is built from source. · shazz/micropython@678ec18 · GitHub
[go: up one dir, main page]

Skip to content

Commit 678ec18

Browse files
committed
extmod/extmod.mk: Integrate mbedTLS so it is built from source.
Setting MICROPY_PY_USSL and MICROPY_SSL_MBEDTLS at the Makefile-level will now build mbedTLS from source and include it in the build, with the ussl module using this TLS library. Extra settings like MBEDTLS_CONFIG_FILE may need to be provided by a given port. If a port wants to use its own mbedTLS library then it should not set MICROPY_SSL_MBEDTLS at the Makefile-level but rather set it at the C level, and provide the library as part of the build in its own way (see eg esp32 port).
1 parent 399417a commit 678ec18

File tree

1 file changed

+75
-4
lines changed

1 file changed

+75
-4
lines changed

extmod/extmod.mk

Lines changed: 75 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,81 @@ SRC_MOD += $(addprefix $(AXTLS_DIR)/,\
2828
crypto/sha1.c \
2929
)
3030
else ifeq ($(MICROPY_SSL_MBEDTLS),1)
31-
# Can be overridden by ports which have "builtin" mbedTLS
32-
MICROPY_SSL_MBEDTLS_INCLUDE ?= $(TOP)/lib/mbedtls/include
33-
CFLAGS_MOD += -DMICROPY_SSL_MBEDTLS=1 -I$(MICROPY_SSL_MBEDTLS_INCLUDE)
34-
LDFLAGS_MOD += -L$(TOP)/lib/mbedtls/library -lmbedx509 -lmbedtls -lmbedcrypto
31+
MBEDTLS_DIR = lib/mbedtls
32+
CFLAGS_MOD += -DMICROPY_SSL_MBEDTLS=1 -I$(TOP)/$(MBEDTLS_DIR)/include
33+
SRC_MOD += $(addprefix $(MBEDTLS_DIR)/library/,\
34+
aes.c \
35+
aesni.c \
36+
arc4.c \
37+
asn1parse.c \
38+
asn1write.c \
39+
base64.c \
40+
bignum.c \
41+
blowfish.c \
42+
camellia.c \
43+
ccm.c \
44+
certs.c \
45+
chacha20.c \
46+
chachapoly.c \
47+
cipher.c \
48+
cipher_wrap.c \
49+
cmac.c \
50+
ctr_drbg.c \
51+
debug.c \
52+
des.c \
53+
dhm.c \
54+
ecdh.c \
55+
ecdsa.c \
56+
ecjpake.c \
57+
ecp.c \
58+
ecp_curves.c \
59+
entropy.c \
60+
entropy_poll.c \
61+
error.c \
62+
gcm.c \
63+
havege.c \
64+
hmac_drbg.c \
65+
md2.c \
66+
md4.c \
67+
md5.c \
68+
md.c \
69+
md_wrap.c \
70+
oid.c \
71+
padlock.c \
72+
pem.c \
73+
pk.c \
74+
pkcs11.c \
75+
pkcs12.c \
76+
pkcs5.c \
77+
pkparse.c \
78+
pk_wrap.c \
79+
pkwrite.c \
80+
platform.c \
81+
platform_util.c \
82+
poly1305.c \
83+
ripemd160.c \
84+
rsa.c \
85+
rsa_internal.c \
86+
sha1.c \
87+
sha256.c \
88+
sha512.c \
89+
ssl_cache.c \
90+
ssl_ciphersuites.c \
91+
ssl_cli.c \
92+
ssl_cookie.c \
93+
ssl_srv.c \
94+
ssl_ticket.c \
95+
ssl_tls.c \
96+
timing.c \
97+
x509.c \
98+
x509_create.c \
99+
x509_crl.c \
100+
x509_crt.c \
101+
x509_csr.c \
102+
x509write_crt.c \
103+
x509write_csr.c \
104+
xtea.c \
105+
)
35106
endif
36107
endif
37108

0 commit comments

Comments
 (0)
0