@@ -37,6 +37,13 @@ UNPACK ?= unzip -q -o
37
37
MBEDTLS_UNPACKLIBDIR = $(MBEDTLS_UNPACKNAME )$(DELIM ) library
38
38
MBEDTLS_UNPACKPROGDIR = $(MBEDTLS_UNPACKNAME )$(DELIM ) programs
39
39
40
+ MBEDTLS_FRAMEWORK_URL ?= "https://github.com/Mbed-TLS/mbedtls-framework/archive"
41
+
42
+ MBEDTLS_FRAMEWORK_VERSION = df3307f2b4fe512def60886024f7be8fd1523ccd
43
+ MBEDTLS_FRAMEWORK_ZIP = $(MBEDTLS_FRAMEWORK_VERSION ) .zip
44
+
45
+ MBEDTLS_FRAMEWORK_UNPACKNAME = mbedtls-framework
46
+
40
47
# This lets Mbed TLS better use some of the POSIX features we have
41
48
CFLAGS += ${DEFINE_PREFIX}unix
42
49
@@ -64,6 +71,10 @@ $(MBEDTLS_ZIP):
64
71
@echo " Downloading: $( MBEDTLS_URL) /$( MBEDTLS_ZIP) "
65
72
$(Q ) curl -O -L $(MBEDTLS_URL ) /$(MBEDTLS_ZIP )
66
73
74
+ $(MBEDTLS_FRAMEWORK_ZIP ) :
75
+ @echo " Downloading: $( MBEDTLS_FRAMEWORK_URL) /$( MBEDTLS_FRAMEWORK_ZIP) "
76
+ $(Q ) curl -O -L $(MBEDTLS_FRAMEWORK_URL ) /$(MBEDTLS_FRAMEWORK_ZIP )
77
+
67
78
$(MBEDTLS_UNPACKNAME ) : $(MBEDTLS_ZIP )
68
79
@echo " Unpacking: $( MBEDTLS_ZIP) -> $( MBEDTLS_UNPACKNAME) "
69
80
$(Q ) $(UNPACK ) $(MBEDTLS_ZIP )
@@ -73,6 +84,11 @@ $(MBEDTLS_UNPACKNAME): $(MBEDTLS_ZIP)
73
84
$(Q ) patch -p1 -d $(MBEDTLS_UNPACKNAME ) < 0003-Fix-MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT-warning.patch
74
85
$(Q ) touch $(MBEDTLS_UNPACKNAME )
75
86
87
+ $(MBEDTLS_FRAMEWORK_UNPACKNAME ) : $(MBEDTLS_FRAMEWORK_ZIP )
88
+ @echo " Unpacking: $( MBEDTLS_ZIP) -> $( MBEDTLS_FRAMEWORK_UNPACKNAME) "
89
+ $(Q ) $(UNPACK ) $(MBEDTLS_FRAMEWORK_ZIP )
90
+ $(Q ) mv mbedtls-framework-$(MBEDTLS_FRAMEWORK_VERSION ) $(MBEDTLS_FRAMEWORK_UNPACKNAME )
91
+
76
92
# Download and unpack tarball if no git repo found
77
93
ifeq ($(wildcard $(MBEDTLS_UNPACKNAME ) /.git) ,)
78
94
context :: $(MBEDTLS_UNPACKNAME )
@@ -106,6 +122,33 @@ STACKSIZE += $(CONFIG_MBEDTLS_APP_SELFTEST_STACKSIZE)
106
122
MAINSRC += $(MBEDTLS_UNPACKPROGDIR ) /test/selftest.c
107
123
endif
108
124
125
+ ifeq ($(CONFIG_MBEDTLS_APP_SSL_CLIENT2 ) ,y)
126
+
127
+ PROGNAME += $(CONFIG_MBEDTLS_APP_SSL_CLIENT2_PROGNAME )
128
+ PRIORITY += $(CONFIG_MBEDTLS_APP_SSL_CLIENT2_PRIORITY )
129
+ STACKSIZE += $(CONFIG_MBEDTLS_APP_SSL_CLIENT2_STACKSIZE )
130
+
131
+ MAINSRC += $(MBEDTLS_UNPACKPROGDIR ) /ssl/ssl_client2.c
132
+ CSRCS += $(MBEDTLS_UNPACKPROGDIR ) /ssl/ssl_test_lib.c
133
+ CSRCS += $(MBEDTLS_UNPACKPROGDIR ) /test/query_config.c
134
+ CSRCS += $(MBEDTLS_UNPACKNAME ) /tests/src/certs.c
135
+ CSRCS += $(MBEDTLS_FRAMEWORK_UNPACKNAME ) /tests/src/helpers.c
136
+ CSRCS += $(MBEDTLS_FRAMEWORK_UNPACKNAME ) /tests/src/psa_crypto_helpers.c
137
+ CFLAGS += ${INCDIR_PREFIX}$(MBEDTLS_UNPACKLIBDIR )
138
+ CFLAGS += ${INCDIR_PREFIX}$(MBEDTLS_UNPACKNAME ) /tests/include
139
+ CFLAGS += ${INCDIR_PREFIX}$(MBEDTLS_FRAMEWORK_UNPACKNAME ) /tests/include
140
+ CFLAGS += ${INCDIR_PREFIX}$(MBEDTLS_FRAMEWORK_UNPACKNAME ) /tests/programs
141
+ endif
142
+
143
+ # Download and unpack tarball if no git repo found
144
+ ifeq ($(wildcard $(MBEDTLS_FRAMEWORK_UNPACKNAME ) /.git) ,)
145
+ context :: $(MBEDTLS_FRAMEWORK_UNPACKNAME )
146
+
147
+ distclean ::
148
+ $(call DELDIR, $(MBEDTLS_FRAMEWORK_UNPACKNAME ) )
149
+ $(call DELFILE, $(MBEDTLS_FRAMEWORK_ZIP ) )
150
+ endif
151
+
109
152
endif
110
153
111
154
# Configuration alternative implementation
0 commit comments