Skip to content

Commit 7c32e81

Browse files
committed
[nrf noup] boot: zephyr: use asn1parse.c from TF-PSA-Crypto when PSA
With the outdated copied source file we would get `asn1parse.c:20:10: fatal error: common.h: No such file or directory` and anyway it's bad practice to do this. Update the path to use the original file directly as is, and also make some adjustments to the Kconfig options that select CONFIG_MBEDTLS_ASN1_PARSE_C. Select it in all cases because it's needed to make the needed functions available in the build. Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
1 parent e8e5038 commit 7c32e81

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

boot/zephyr/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ elseif(CONFIG_BOOT_SIGNATURE_TYPE_ED25519 OR CONFIG_BOOT_ENCRYPT_X25519)
341341
else()
342342
if(MBEDTLS_ASN1_DIR)
343343
zephyr_library_sources(
344-
${MBEDTLS_ASN1_DIR}/src/asn1parse.c
344+
${ZEPHYR_OBERON_PSA_CRYPTO_MODULE_DIR}/utilities/asn1parse.c
345345
)
346346
endif()
347347
if(NOT CONFIG_BOOT_SIGNATURE_USING_KMU AND NOT CONFIG_NCS_BOOT_SIGNATURE_USING_ITS)

boot/zephyr/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,14 +362,14 @@ config BOOT_ED25519_MBEDTLS
362362
select BOOT_IMG_HASH_ALG_SHA512_ALLOW
363363
select MBEDTLS
364364
select MBEDTLS_SHA512
365-
select MBEDTLS_ASN1_PARSE_C if MBEDTLS_BUILTIN && !BOOT_KEY_IMPORT_BYPASS_ASN
365+
select MBEDTLS_ASN1_PARSE_C if !BOOT_KEY_IMPORT_BYPASS_ASN
366366
select BOOT_AES_MBEDTLS_DEPENDENCIES if MBEDTLS_BUILTIN && BOOT_ENCRYPT_IMAGE
367367

368368
config BOOT_ED25519_PSA
369369
bool "Use PSA crypto"
370370
select BOOT_USE_PSA_CRYPTO
371371
select PSA_CRYPTO
372-
select MBEDTLS_ASN1_PARSE_C if MBEDTLS_BUILTIN
372+
select MBEDTLS_ASN1_PARSE_C
373373
select MBEDTLS_ENABLE_HEAP if !PSA_CORE_LITE
374374
select BOOT_IMG_HASH_ALG_SHA256_ALLOW if !PSA_CORE_LITE
375375
select BOOT_IMG_HASH_ALG_SHA512_ALLOW if !PSA_CORE_LITE

0 commit comments

Comments
 (0)