Skip to content

Commit 1004c9c

Browse files
Merge pull request #9340 from ronald-cron-arm/move-mbedtls-crypto-modules
Move mbedtls crypto modules
2 parents fe3ad99 + 1992c91 commit 1004c9c

File tree

200 files changed

+973
-421
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

200 files changed

+973
-421
lines changed

3rdparty/Makefile.inc

Lines changed: 0 additions & 3 deletions
This file was deleted.

CMakeLists.txt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -294,12 +294,10 @@ add_subdirectory(framework)
294294

295295
add_subdirectory(include)
296296

297-
add_subdirectory(3rdparty)
297+
add_subdirectory(tf-psa-crypto)
298298

299299
add_subdirectory(library)
300300

301-
add_subdirectory(tf-psa-crypto)
302-
303301
add_subdirectory(pkgconfig)
304302

305303
#
@@ -357,7 +355,9 @@ if(ENABLE_TESTING OR ENABLE_PROGRAMS)
357355
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include
358356
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tf-psa-crypto/include
359357
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tf-psa-crypto/drivers/builtin/include
360-
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/library)
358+
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/library
359+
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tf-psa-crypto/core
360+
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tf-psa-crypto/drivers/builtin/src)
361361
# Request C11, needed for memory poisoning tests
362362
set_target_properties(mbedtls_test PROPERTIES C_STANDARD 11)
363363

@@ -370,7 +370,9 @@ if(ENABLE_TESTING OR ENABLE_PROGRAMS)
370370
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tf-psa-crypto/include
371371
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tf-psa-crypto/drivers/builtin/include
372372
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/library
373-
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/everest/include)
373+
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tf-psa-crypto/core
374+
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tf-psa-crypto/drivers/builtin/src
375+
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tf-psa-crypto/drivers/everest/include)
374376

375377
# Pass-through MBEDTLS_CONFIG_FILE and MBEDTLS_USER_CONFIG_FILE
376378
if(MBEDTLS_CONFIG_FILE)

Makefile

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -200,12 +200,18 @@ endif
200200

201201
## Editor navigation files
202202
C_SOURCE_FILES = $(wildcard \
203-
3rdparty/*/include/*/*.h 3rdparty/*/include/*/*/*.h 3rdparty/*/include/*/*/*/*.h \
204-
3rdparty/*/*.c 3rdparty/*/*/*.c 3rdparty/*/*/*/*.c 3rdparty/*/*/*/*/*.c \
205203
include/*/*.h \
206204
library/*.[hc] \
205+
tf-psa-crypto/core/*.[hc] \
207206
tf-psa-crypto/include/*/*.h \
208-
tf-psa-crypto/drivers/builtin/include/*/*.h \
207+
tf-psa-crypto/drivers/*/include/*/*.h \
208+
tf-psa-crypto/drivers/*/include/*/*/*.h \
209+
tf-psa-crypto/drivers/*/include/*/*/*/*.h \
210+
tf-psa-crypto/drivers/builtin/src/*.[hc] \
211+
tf-psa-crypto/drivers/*/*.c \
212+
tf-psa-crypto/drivers/*/*/*.c \
213+
tf-psa-crypto/drivers/*/*/*/*.c \
214+
tf-psa-crypto/drivers/*/*/*/*/*.c \
209215
programs/*/*.[hc] \
210216
tests/include/*/*.h tests/include/*/*/*.h \
211217
tests/src/*.c tests/src/*/*.c \
@@ -222,7 +228,8 @@ GPATH GRTAGS GSYMS GTAGS: $(C_SOURCE_FILES)
222228
ls $(C_SOURCE_FILES) | gtags -f - --gtagsconf .globalrc
223229
cscope: cscope.in.out cscope.po.out cscope.out
224230
cscope.in.out cscope.po.out cscope.out: $(C_SOURCE_FILES)
225-
cscope -bq -u -Iinclude -Ilibrary -Itf-psa-crypto/include \
226-
-Itf-psa-crypto/drivers/builtin/include \
227-
$(patsubst %,-I%,$(wildcard 3rdparty/*/include)) -Itests/include $(C_SOURCE_FILES)
231+
cscope -bq -u -Iinclude -Ilibrary -Itf-psa-crypto/core \
232+
-Itf-psa-crypto/include \
233+
-Itf-psa-crypto/drivers/builtin/src \
234+
$(patsubst %,-I%,$(wildcard tf-psa-crypto/drivers/*/include)) -Itests/include $(C_SOURCE_FILES)
228235
.PHONY: cscope global

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -315,10 +315,10 @@ Unless specifically indicated otherwise in a file, Mbed TLS files are provided u
315315
316316
### Third-party code included in Mbed TLS
317317
318-
This project contains code from other projects. This code is located within the `3rdparty/` directory. The original license text is included within project subdirectories, where it differs from the normal Mbed TLS license, and/or in source files. The projects are listed below:
318+
This project contains code from other projects. This code is located within the `tf-psa-crypto/drivers/` directory. The original license text is included within project subdirectories, where it differs from the normal Mbed TLS license, and/or in source files. The projects are listed below:
319319
320-
* `3rdparty/everest/`: Files stem from [Project Everest](https://project-everest.github.io/) and are distributed under the Apache 2.0 license.
321-
* `3rdparty/p256-m/p256-m/`: Files have been taken from the [p256-m](https://github.com/mpg/p256-m) repository. The code in the original repository is distributed under the Apache 2.0 license. It is distributed in Mbed TLS under a dual Apache-2.0 OR GPL-2.0-or-later license with permission from the author.
320+
* `drivers/everest/`: Files stem from [Project Everest](https://project-everest.github.io/) and are distributed under the Apache 2.0 license.
321+
* `drivers/p256-m/p256-m/`: Files have been taken from the [p256-m](https://github.com/mpg/p256-m) repository. The code in the original repository is distributed under the Apache 2.0 license. It is distributed in Mbed TLS under a dual Apache-2.0 OR GPL-2.0-or-later license with permission from the author.
322322
323323
Contributing
324324
------------

docs/psa-driver-example-and-guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ This guide assumes you are building Mbed TLS from source alongside your project.
138138
139139
### Example: Manually integrating a software accelerator alongside Mbed TLS
140140
141-
[p256-m](https://github.com/mpg/p256-m) is a minimalistic implementation of ECDH and ECDSA on the NIST P-256 curve, specifically optimized for use in constrained 32-bit environments. It started out as an independent project and has been integrated in Mbed TLS as a PSA transparent driver. The source code of p256-m and the driver entry points is located in the Mbed TLS source tree under `3rdparty/p256-m`. In this section, we will look at how this integration was done.
141+
[p256-m](https://github.com/mpg/p256-m) is a minimalistic implementation of ECDH and ECDSA on the NIST P-256 curve, specifically optimized for use in constrained 32-bit environments. It started out as an independent project and has been integrated in Mbed TLS as a PSA transparent driver. The source code of p256-m and the driver entry points is located in the Mbed TLS source tree under `drivers/p256-m`. In this section, we will look at how this integration was done.
142142
143143
The Mbed TLS build system includes the instructions needed to build p256-m. To build with and use p256-m, set the macro `MBEDTLS_PSA_P256M_DRIVER_ENABLED` using `config.py`, then build as usual using make/cmake. From the root of the `mbedtls/` directory, run:
144144

framework

library/.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,4 @@ libmbed*
66
/error.c
77
/version_features.c
88
/ssl_debug_helpers_generated.c
9-
/psa_crypto_driver_wrappers.h
10-
/psa_crypto_driver_wrappers_no_static.c
119
###END_GENERATED_FILES###

library/CMakeLists.txt

Lines changed: 100 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -10,87 +10,90 @@ if(NOT DEFINED MBEDTLS_DIR)
1010
set(MBEDTLS_DIR ${CMAKE_SOURCE_DIR})
1111
endif()
1212

13+
set(TF_PSA_CRYPTO_CORE_DIR ../tf-psa-crypto/core)
14+
set(TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR ../tf-psa-crypto/drivers/builtin/src)
15+
1316
set(src_crypto
14-
aes.c
15-
aesni.c
16-
aesce.c
17-
aria.c
18-
asn1parse.c
19-
asn1write.c
20-
base64.c
21-
bignum.c
22-
bignum_core.c
23-
bignum_mod.c
24-
bignum_mod_raw.c
25-
block_cipher.c
26-
camellia.c
27-
ccm.c
28-
chacha20.c
29-
chachapoly.c
30-
cipher.c
31-
cipher_wrap.c
32-
constant_time.c
33-
cmac.c
34-
ctr_drbg.c
35-
des.c
36-
dhm.c
37-
ecdh.c
38-
ecdsa.c
39-
ecjpake.c
40-
ecp.c
41-
ecp_curves.c
42-
ecp_curves_new.c
43-
entropy.c
44-
entropy_poll.c
45-
error.c
46-
gcm.c
47-
hkdf.c
48-
hmac_drbg.c
49-
lmots.c
50-
lms.c
51-
md.c
52-
md5.c
53-
memory_buffer_alloc.c
54-
nist_kw.c
55-
oid.c
56-
pem.c
57-
pk.c
58-
pk_ecc.c
59-
pk_wrap.c
60-
pkcs12.c
61-
pkcs5.c
62-
pkparse.c
63-
pkwrite.c
64-
platform.c
65-
platform_util.c
66-
poly1305.c
67-
psa_crypto.c
68-
psa_crypto_aead.c
69-
psa_crypto_cipher.c
70-
psa_crypto_client.c
71-
psa_crypto_driver_wrappers_no_static.c
72-
psa_crypto_ecp.c
73-
psa_crypto_ffdh.c
74-
psa_crypto_hash.c
75-
psa_crypto_mac.c
76-
psa_crypto_pake.c
77-
psa_crypto_rsa.c
78-
psa_crypto_se.c
79-
psa_crypto_slot_management.c
80-
psa_crypto_storage.c
81-
psa_its_file.c
82-
psa_util.c
83-
ripemd160.c
84-
rsa.c
85-
rsa_alt_helpers.c
86-
sha1.c
87-
sha256.c
88-
sha512.c
89-
sha3.c
90-
threading.c
91-
timing.c
92-
version.c
93-
version_features.c
17+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/aes.c
18+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/aesni.c
19+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/aesce.c
20+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/aria.c
21+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/asn1parse.c
22+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/asn1write.c
23+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/base64.c
24+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/bignum.c
25+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/bignum_core.c
26+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/bignum_mod.c
27+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/bignum_mod_raw.c
28+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/block_cipher.c
29+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/camellia.c
30+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/ccm.c
31+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/chacha20.c
32+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/chachapoly.c
33+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/cipher.c
34+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/cipher_wrap.c
35+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/constant_time.c
36+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/cmac.c
37+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/ctr_drbg.c
38+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/des.c
39+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/dhm.c
40+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/ecdh.c
41+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/ecdsa.c
42+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/ecjpake.c
43+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/ecp.c
44+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/ecp_curves.c
45+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/ecp_curves_new.c
46+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/entropy.c
47+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/entropy_poll.c
48+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/error.c
49+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/gcm.c
50+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/hkdf.c
51+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/hmac_drbg.c
52+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/lmots.c
53+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/lms.c
54+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/md.c
55+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/md5.c
56+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/memory_buffer_alloc.c
57+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/nist_kw.c
58+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/oid.c
59+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/pem.c
60+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/pk.c
61+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/pk_ecc.c
62+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/pk_wrap.c
63+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/pkcs12.c
64+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/pkcs5.c
65+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/pkparse.c
66+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/pkwrite.c
67+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/platform.c
68+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/platform_util.c
69+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/poly1305.c
70+
${TF_PSA_CRYPTO_CORE_DIR}/psa_crypto.c
71+
${TF_PSA_CRYPTO_CORE_DIR}/psa_crypto_aead.c
72+
${TF_PSA_CRYPTO_CORE_DIR}/psa_crypto_cipher.c
73+
${TF_PSA_CRYPTO_CORE_DIR}/psa_crypto_client.c
74+
${TF_PSA_CRYPTO_CORE_DIR}/psa_crypto_driver_wrappers_no_static.c
75+
${TF_PSA_CRYPTO_CORE_DIR}/psa_crypto_ecp.c
76+
${TF_PSA_CRYPTO_CORE_DIR}/psa_crypto_ffdh.c
77+
${TF_PSA_CRYPTO_CORE_DIR}/psa_crypto_hash.c
78+
${TF_PSA_CRYPTO_CORE_DIR}/psa_crypto_mac.c
79+
${TF_PSA_CRYPTO_CORE_DIR}/psa_crypto_pake.c
80+
${TF_PSA_CRYPTO_CORE_DIR}/psa_crypto_rsa.c
81+
${TF_PSA_CRYPTO_CORE_DIR}/psa_crypto_se.c
82+
${TF_PSA_CRYPTO_CORE_DIR}/psa_crypto_slot_management.c
83+
${TF_PSA_CRYPTO_CORE_DIR}/psa_crypto_storage.c
84+
${TF_PSA_CRYPTO_CORE_DIR}/psa_its_file.c
85+
${TF_PSA_CRYPTO_CORE_DIR}/psa_util.c
86+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/ripemd160.c
87+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/rsa.c
88+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/rsa_alt_helpers.c
89+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/sha1.c
90+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/sha256.c
91+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/sha512.c
92+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/sha3.c
93+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/threading.c
94+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/timing.c
95+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/version.c
96+
${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/version_features.c
9497
)
9598

9699
set(src_x509
@@ -133,14 +136,14 @@ if(GEN_FILES)
133136
file(GLOB tls_error_headers ${CMAKE_CURRENT_SOURCE_DIR}/../include/mbedtls/*.h)
134137
add_custom_command(
135138
OUTPUT
136-
${CMAKE_CURRENT_BINARY_DIR}/error.c
139+
${CMAKE_CURRENT_BINARY_DIR}/${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/error.c
137140
COMMAND
138141
${PERL_EXECUTABLE}
139142
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/generate_errors.pl
140143
${CMAKE_CURRENT_SOURCE_DIR}/../tf-psa-crypto/drivers/builtin/include/mbedtls
141144
${CMAKE_CURRENT_SOURCE_DIR}/../include/mbedtls
142145
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/data_files
143-
${CMAKE_CURRENT_BINARY_DIR}/error.c
146+
${CMAKE_CURRENT_BINARY_DIR}/${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/error.c
144147
DEPENDS
145148
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/generate_errors.pl
146149
${crypto_error_headers}
@@ -150,13 +153,13 @@ if(GEN_FILES)
150153

151154
add_custom_command(
152155
OUTPUT
153-
${CMAKE_CURRENT_BINARY_DIR}/version_features.c
156+
${CMAKE_CURRENT_BINARY_DIR}/${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/version_features.c
154157
COMMAND
155158
${PERL_EXECUTABLE}
156159
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/generate_features.pl
157160
${CMAKE_CURRENT_SOURCE_DIR}/../include/mbedtls
158161
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/data_files
159-
${CMAKE_CURRENT_BINARY_DIR}/version_features.c
162+
${CMAKE_CURRENT_BINARY_DIR}/${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/version_features.c
160163
DEPENDS
161164
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/generate_features.pl
162165
${CMAKE_CURRENT_SOURCE_DIR}/../include/mbedtls/mbedtls_config.h
@@ -178,24 +181,23 @@ if(GEN_FILES)
178181

179182
add_custom_command(
180183
OUTPUT
181-
${CMAKE_CURRENT_BINARY_DIR}/psa_crypto_driver_wrappers.h
182-
${CMAKE_CURRENT_BINARY_DIR}/psa_crypto_driver_wrappers_no_static.c
184+
${CMAKE_CURRENT_BINARY_DIR}/${TF_PSA_CRYPTO_CORE_DIR}/psa_crypto_driver_wrappers.h
185+
${CMAKE_CURRENT_BINARY_DIR}/${TF_PSA_CRYPTO_CORE_DIR}/psa_crypto_driver_wrappers_no_static.c
183186
COMMAND
184187
${MBEDTLS_PYTHON_EXECUTABLE}
185188
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/generate_driver_wrappers.py
186-
${CMAKE_CURRENT_BINARY_DIR}
189+
${CMAKE_CURRENT_BINARY_DIR}/${TF_PSA_CRYPTO_CORE_DIR}
187190
DEPENDS
188191
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/generate_driver_wrappers.py
189192
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/data_files/driver_templates/psa_crypto_driver_wrappers.h.jinja
190193
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/data_files/driver_templates/psa_crypto_driver_wrappers_no_static.c.jinja
191194
)
192-
193-
194195
else()
195-
link_to_source(error.c)
196-
link_to_source(version_features.c)
196+
link_to_source(${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/error.c)
197+
link_to_source(${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/version_features.c)
197198
link_to_source(ssl_debug_helpers_generated.c)
198-
link_to_source(psa_crypto_driver_wrappers_no_static.c)
199+
link_to_source(${TF_PSA_CRYPTO_CORE_DIR}/psa_crypto_driver_wrappers.h)
200+
link_to_source(${TF_PSA_CRYPTO_CORE_DIR}/psa_crypto_driver_wrappers_no_static.c)
199201
endif()
200202

201203
if(CMAKE_COMPILER_IS_GNUCC)
@@ -324,19 +326,19 @@ endif(USE_SHARED_MBEDTLS_LIBRARY)
324326

325327
foreach(target IN LISTS target_libraries)
326328
add_library(MbedTLS::${target} ALIAS ${target}) # add_subdirectory support
327-
# Include public header files from /include and other directories
328-
# declared by /3rdparty/**/CMakeLists.txt. Include private header files
329-
# from /library and others declared by /3rdparty/**/CMakeLists.txt.
330-
# /library needs to be listed explicitly when building .c files outside
331-
# of /library (which currently means: under /3rdparty).
329+
# Include public header files from /include, /tf-psa-crypto/include/ and
330+
# tf-psa-crypto/drivers/builtin/include/. Include private header files
331+
# from /library, tf-psa-crypto/core/ and tf-psa-crypto/drivers/builtin/src/.
332332
target_include_directories(${target}
333333
PUBLIC $<BUILD_INTERFACE:${MBEDTLS_DIR}/include/>
334334
$<BUILD_INTERFACE:${MBEDTLS_DIR}/tf-psa-crypto/include/>
335335
$<BUILD_INTERFACE:${MBEDTLS_DIR}/tf-psa-crypto/drivers/builtin/include/>
336336
$<INSTALL_INTERFACE:include/>
337337
PRIVATE ${MBEDTLS_DIR}/library/
338+
${MBEDTLS_DIR}/tf-psa-crypto/core
339+
${MBEDTLS_DIR}/tf-psa-crypto/drivers/builtin/src
338340
# Needed to include psa_crypto_driver_wrappers.h
339-
${CMAKE_CURRENT_BINARY_DIR})
341+
${CMAKE_CURRENT_BINARY_DIR}/../tf-psa-crypto/core)
340342
# Pass-through MBEDTLS_CONFIG_FILE and MBEDTLS_USER_CONFIG_FILE
341343
if(MBEDTLS_CONFIG_FILE)
342344
target_compile_definitions(${target}

0 commit comments

Comments
 (0)