|
2 | 2 | # |
3 | 3 | # SPDX-License-Identifier: Apache-2.0 |
4 | 4 |
|
5 | | -# Copy header files related to legacy crypto to the build folder in a path |
6 | | -# that does not contain "private" in the name. This allows legacy includes |
7 | | -# like "#include <mbedtls/ecp.h>" to still work. This is a temporary |
8 | | -# fix in order not to break external modules (ex: hostap) which are |
9 | | -# still referencing legacy includes. However these files are private now |
10 | | -# and all the users of legacy Mbed TLS should transition to PSA API as soon |
11 | | -# as possible! |
| 5 | +# When CONFIG_MBEDTLS_DECLARE_PRIVATE_IDENTIFIERS is enabled, legacy crypto |
| 6 | +# declarations live under mbedtls/private/*.h in TF-PSA-Crypto builtin |
| 7 | +# includes. The mbedtls CMake target already exports |
| 8 | +# tf-psa-crypto/drivers/builtin/include on its INTERFACE, so consumers must |
| 9 | +# include the private paths explicitly (no flattened header copy). |
12 | 10 | if(CONFIG_MBEDTLS_DECLARE_PRIVATE_IDENTIFIERS) |
13 | 11 | message(WARNING " |
14 | 12 | Enabling CONFIG_MBEDTLS_DECLARE_PRIVATE_IDENTIFIERS is discouraged as it |
15 | 13 | gives access to Mbed TLS crypto functions which are internal and may be removed |
16 | 14 | or modified at any time. Please transition to the PSA Crypto API." |
17 | 15 | ) |
18 | | - set(MBEDTLS_PRIVATE_INCLUDE_PATH "${ZEPHYR_TF_PSA_CRYPTO_MODULE_DIR}/drivers/builtin/include/mbedtls/private") |
19 | | - set(legacy_headers |
20 | | - ${MBEDTLS_PRIVATE_INCLUDE_PATH}/aes.h |
21 | | - ${MBEDTLS_PRIVATE_INCLUDE_PATH}/bignum.h |
22 | | - ${MBEDTLS_PRIVATE_INCLUDE_PATH}/cipher.h |
23 | | - ${MBEDTLS_PRIVATE_INCLUDE_PATH}/cmac.h |
24 | | - ${MBEDTLS_PRIVATE_INCLUDE_PATH}/ecdsa.h |
25 | | - ${MBEDTLS_PRIVATE_INCLUDE_PATH}/ecp.h |
26 | | - ${MBEDTLS_PRIVATE_INCLUDE_PATH}/pkcs5.h |
27 | | - ${MBEDTLS_PRIVATE_INCLUDE_PATH}/error_common.h |
28 | | - ${MBEDTLS_PRIVATE_INCLUDE_PATH}/sha256.h |
29 | | - ${MBEDTLS_PRIVATE_INCLUDE_PATH}/rsa.h |
30 | | - ) |
31 | | - file(COPY ${legacy_headers} DESTINATION ${CMAKE_BINARY_DIR}/legacy-mbedtls-headers/mbedtls/) |
| 16 | + # MCUBoot bootutil includes rsa_alt_helpers.h by basename; the header lives |
| 17 | + # next to builtin RSA sources under drivers/builtin/src. |
32 | 18 | if(CONFIG_MCUBOOT) |
33 | | - set(MBEDTLS_BUILTIN_SRC_PATH "${ZEPHYR_TF_PSA_CRYPTO_MODULE_DIR}/drivers/builtin/src") |
34 | | - set(legacy_headers |
35 | | - ${MBEDTLS_BUILTIN_SRC_PATH}/rsa_alt_helpers.h |
| 19 | + target_include_directories(mbedTLS INTERFACE |
| 20 | + ${ZEPHYR_TF_PSA_CRYPTO_MODULE_DIR}/drivers/builtin/src |
36 | 21 | ) |
37 | | - file(COPY ${legacy_headers} DESTINATION ${CMAKE_BINARY_DIR}/legacy-mbedtls-headers/) |
38 | 22 | endif() |
39 | | - target_include_directories(mbedTLS INTERFACE |
40 | | - ${CMAKE_BINARY_DIR}/legacy-mbedtls-headers/ |
41 | | - ) |
42 | 23 | endif() |
43 | 24 |
|
44 | 25 | set(MBEDTLS_EXPORT_REMOVED_HEADERS OFF) |
|
0 commit comments