Skip to content

Commit b475adf

Browse files
committed
zephyr: Add CONFIG_BOOT_BYPASS_KEY_MATCH
Add Zephyr support for MCUBOOT_BYPASS_KEY_MATCH Signed-off-by: Dominik Ermel <[email protected]>
1 parent 6d943d6 commit b475adf

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

boot/zephyr/Kconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,19 @@ endif
375375

376376
endchoice
377377

378+
config BOOT_BYPASS_KEY_MATCH
379+
bool "Do not match TLV key hash against built in key"
380+
depends on !BOOT_SIGNATURE_TYPE_NONE
381+
depends on !BOOT_HW_KEY
382+
help
383+
MCUboot reads, from TLV, hash of a key that should be used to verify
384+
a signature and uses it to find a builtin key.
385+
This action is pointless when there is single key compiled in,
386+
as the signature verification process will just fail if that is not
387+
the right key.
388+
Enabling this option turns off key matching, slightly reducing
389+
MCUboot code and boot time.
390+
378391
config BOOT_SIGNATURE_KEY_FILE
379392
string "PEM key file"
380393
default "root-ec-p256.pem" if BOOT_SIGNATURE_TYPE_ECDSA_P256

boot/zephyr/include/mcuboot_config/mcuboot_config.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,15 @@
172172
#define MCUBOOT_HMAC_SHA512
173173
#endif
174174

175+
/* Turn off check of public key hash against compiled in key
176+
* before attempting signature verification. When there is only
177+
* one key, matching is pointless, the signature may just be
178+
* verified with the only key that there is.
179+
*/
180+
#ifdef CONFIG_BOOT_BYPASS_KEY_MATCH
181+
#define MCUBOOT_BYPASS_KEY_MATCH
182+
#endif
183+
175184
#ifdef CONFIG_BOOT_DECOMPRESSION
176185
#define MCUBOOT_DECOMPRESS_IMAGES
177186
#endif

0 commit comments

Comments
 (0)