Skip to content

Commit 1b930a9

Browse files
committed
[nrf mergeup] merge upsteram up to commit 5e6f5e0
Signed-off-by: Andrzej Puzdrowski <[email protected]>
2 parents 5e7fcb2 + 5e6f5e0 commit 1b930a9

Some content is hidden

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

41 files changed

+763
-2260
lines changed

boot/bootutil/include/bootutil/caps.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ uint32_t bootutil_get_caps(void);
4141
#define BOOTUTIL_CAP_ENC_KW (1<<6)
4242
#define BOOTUTIL_CAP_VALIDATE_PRIMARY_SLOT (1<<7)
4343

44+
/*
45+
* Query the number of images this bootloader is configured for. This
46+
* is also primarily used for testing.
47+
*/
48+
uint32_t bootutil_get_num_images(void);
49+
4450
#ifdef __cplusplus
4551
}
4652
#endif

boot/bootutil/include/bootutil/sha256.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,9 @@
3131

3232
#include "mcuboot_config/mcuboot_config.h"
3333

34-
#define NUM_CRYPTO_BACKENDS (defined(MCUBOOT_USE_MBED_TLS) +\
35-
defined(MCUBOOT_USE_TINYCRYPT) +\
36-
defined(MCUBOOT_USE_CC310))
37-
#if NUM_CRYPTO_BACKENDS != 1
34+
#if (defined(MCUBOOT_USE_MBED_TLS) + \
35+
defined(MCUBOOT_USE_TINYCRYPT) + \
36+
defined(MCUBOOT_USE_CC310)) != 1
3837
#error "One crypto backend must be defined either CC310, MBED_TLS or TINYCRYPT"
3938
#endif
4039

boot/bootutil/src/caps.c

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,31 +19,40 @@
1919

2020
uint32_t bootutil_get_caps(void)
2121
{
22-
uint32_t res = 0;
22+
uint32_t res = 0;
2323

2424
#if defined(MCUBOOT_SIGN_RSA)
25-
res |= BOOTUTIL_CAP_RSA2048;
25+
res |= BOOTUTIL_CAP_RSA2048;
2626
#endif
2727
#if defined(MCUBOOT_SIGN_EC)
28-
res |= BOOTUTIL_CAP_ECDSA_P224;
28+
res |= BOOTUTIL_CAP_ECDSA_P224;
2929
#endif
3030
#if defined(MCUBOOT_SIGN_EC256)
31-
res |= BOOTUTIL_CAP_ECDSA_P256;
31+
res |= BOOTUTIL_CAP_ECDSA_P256;
3232
#endif
3333
#if defined(MCUBOOT_OVERWRITE_ONLY)
34-
res |= BOOTUTIL_CAP_OVERWRITE_UPGRADE;
34+
res |= BOOTUTIL_CAP_OVERWRITE_UPGRADE;
3535
#else
36-
res |= BOOTUTIL_CAP_SWAP_UPGRADE;
36+
res |= BOOTUTIL_CAP_SWAP_UPGRADE;
3737
#endif
3838
#if defined(MCUBOOT_ENCRYPT_RSA)
39-
res |= BOOTUTIL_CAP_ENC_RSA;
39+
res |= BOOTUTIL_CAP_ENC_RSA;
4040
#endif
4141
#if defined(MCUBOOT_ENCRYPT_KW)
42-
res |= BOOTUTIL_CAP_ENC_KW;
42+
res |= BOOTUTIL_CAP_ENC_KW;
4343
#endif
4444
#if defined(MCUBOOT_VALIDATE_PRIMARY_SLOT)
45-
res |= BOOTUTIL_CAP_VALIDATE_PRIMARY_SLOT;
45+
res |= BOOTUTIL_CAP_VALIDATE_PRIMARY_SLOT;
4646
#endif
4747

48-
return res;
48+
return res;
49+
}
50+
51+
uint32_t bootutil_get_num_images(void)
52+
{
53+
#if defined(MCUBOOT_IMAGE_NUMBER)
54+
return MCUBOOT_IMAGE_NUMBER;
55+
#else
56+
return 1;
57+
#endif
4958
}

boot/bootutil/test/pkg.yml

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

boot/bootutil/test/src/boot_test.c

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

boot/bootutil/test/src/boot_test.h

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

0 commit comments

Comments
 (0)