Skip to content

Commit 3c08c6c

Browse files
michalek-notomi-font
authored andcommitted
[nrf noup] boot: bootutil: encrypted*.c: fix Mbed TLS header inclusion
It's needed for MBEDTLS_OID_EC_ALG_UNRESTRICTED, which is gone from the Mbed TLS repo itself and is now in a different header in TF-PSA-Crypto. Enable MBEDTLS_DECLARE_PRIVATE_IDENTIFIERS in PSA ECDSA and ED25519 builds otherwise we get errors because of missing types in the inclusion of this new header file. Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
1 parent 3d35d9e commit 3c08c6c

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

boot/bootutil/src/encrypted.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
#if defined(MCUBOOT_ENCRYPT_EC256) || defined(MCUBOOT_ENCRYPT_X25519)
3939
#include "bootutil/crypto/sha.h"
4040
#include "bootutil/crypto/hmac_sha256.h"
41-
#include "mbedtls/oid.h"
41+
#include "crypto_oid.h"
4242
#include "mbedtls/asn1.h"
4343
#endif
4444
#endif

boot/bootutil/src/encrypted_psa.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#define MBEDTLS_ASN1_PARSE_C
1515

1616
#include "bootutil/crypto/sha.h"
17-
#include "mbedtls/oid.h"
17+
#include "crypto_oid.h"
1818
#include "mbedtls/asn1.h"
1919

2020
#include "bootutil/image.h"

boot/zephyr/Kconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ config BOOT_ED25519_PSA_DEPENDENCIES
9898
select PSA_WANT_ECC_TWISTED_EDWARDS_255
9999
select PSA_WANT_ECC_MONTGOMERY_255
100100
select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT if !PSA_CORE_LITE
101+
select MBEDTLS_DECLARE_PRIVATE_IDENTIFIERS if BOOT_ENCRYPT_X25519
101102
help
102103
Dependencies for ed25519 signature
103104

@@ -127,6 +128,7 @@ config BOOT_ECDSA_PSA_DEPENDENCIES
127128
select PSA_WANT_ALG_ECDSA
128129
select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT if !PSA_CORE_LITE
129130
select PSA_WANT_ECC_SECP_R1_256
131+
select MBEDTLS_DECLARE_PRIVATE_IDENTIFIERS if BOOT_ENCRYPT_EC256
130132
help
131133
Dependencies for ECDSA signature
132134

@@ -289,6 +291,10 @@ config BOOT_SIGNATURE_TYPE_ECDSA_P256
289291
bool "Elliptic curve digital signatures with curve P-256"
290292
select BOOT_ENCRYPTION_SUPPORT
291293
select BOOT_IMG_HASH_ALG_SHA256_ALLOW
294+
# Enable nrf_security for include paths to oberon-psa-crypto which has mbedtls headers
295+
# (e.g. crypto_oid.h), needed also in cases other than BOOT_ECDSA_PSA.
296+
select NRF_SECURITY
297+
imply MBEDTLS_ASN1_PARSE_C
292298

293299
if BOOT_SIGNATURE_TYPE_ECDSA_P256
294300
choice BOOT_ECDSA_IMPLEMENTATION

0 commit comments

Comments
 (0)