Skip to content

Commit 591c3e5

Browse files
committed
bootutil: Add support for multi-sign of same type
This commit adds functionality to the bootutil library to support multiple sign verfication of same type when 'MCUBOOT_BUILTIN_KEY' or 'MCUBOOT_HW_KEY' is enabled. Signed-off-by: Maulik Patel <[email protected]> Change-Id: I05c97ac385c5816c812c51feb010028df8412fe5
1 parent 6f6a6f6 commit 591c3e5

File tree

4 files changed

+566
-23
lines changed

4 files changed

+566
-23
lines changed

boot/bootutil/CMakeLists.txt

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,32 @@ target_include_directories(bootutil
1414
src
1515
)
1616

17-
target_sources(bootutil
18-
PRIVATE
19-
src/boot_record.c
20-
src/bootutil_misc.c
21-
src/bootutil_public.c
22-
src/caps.c
23-
src/encrypted.c
24-
src/fault_injection_hardening.c
25-
src/fault_injection_hardening_delay_rng_mbedtls.c
26-
src/image_ecdsa.c
27-
src/image_ed25519.c
28-
src/image_rsa.c
29-
src/image_validate.c
30-
src/loader.c
31-
src/swap_misc.c
32-
src/swap_move.c
33-
src/swap_scratch.c
34-
src/tlv.c
17+
set(BOOTUTIL_SOURCES
18+
src/boot_record.c
19+
src/bootutil_misc.c
20+
src/bootutil_public.c
21+
src/caps.c
22+
src/encrypted.c
23+
src/fault_injection_hardening.c
24+
src/fault_injection_hardening_delay_rng_mbedtls.c
25+
src/image_ecdsa.c
26+
src/image_ed25519.c
27+
src/image_rsa.c
28+
src/loader.c
29+
src/swap_misc.c
30+
src/swap_move.c
31+
src/swap_scratch.c
32+
src/tlv.c
3533
)
34+
3635
if(CONFIG_BOOT_RAM_LOAD)
37-
target_sources(bootutil
38-
PRIVATE
39-
src/ram_load.c
40-
)
36+
list(APPEND BOOTUTIL_SOURCES src/ram_load.c)
4137
endif()
38+
39+
if(MCUBOOT_IMAGE_MULTI_SIG_SUPPORT)
40+
list(APPEND BOOTUTIL_SOURCES src/image_multi_sig.c)
41+
else()
42+
list(APPEND BOOTUTIL_SOURCES src/image_validate.c)
43+
endif()
44+
45+
target_sources(bootutil PRIVATE ${BOOTUTIL_SOURCES})

boot/bootutil/include/bootutil/sign_key.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,18 @@ extern struct bootutil_key bootutil_keys[];
6262
* Retrieve the hash of the corresponding public key for image authentication.
6363
*
6464
* @param[in] image_index Index of the image to be authenticated.
65+
* @param[in] key_index Index of the key to be used.
6566
* @param[out] public_key_hash Buffer to store the key-hash in.
6667
* @param[in,out] key_hash_size As input the size of the buffer. As output
6768
* the actual key-hash length.
6869
*
6970
* @return 0 on success; nonzero on failure.
7071
*/
7172
int boot_retrieve_public_key_hash(uint8_t image_index,
73+
uint8_t key_index,
7274
uint8_t *public_key_hash,
7375
size_t *key_hash_size);
76+
7477
#endif /* !MCUBOOT_HW_KEY */
7578

7679
extern const int bootutil_key_cnt;

0 commit comments

Comments
 (0)