Skip to content

Commit e93f807

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 39bfdeb commit e93f807

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
@@ -325,6 +325,19 @@ endif
325325

326326
endchoice
327327

328+
config BOOT_BYPASS_KEY_MATCH
329+
bool "Do not match TLV key hash against built in key"
330+
depends on !BOOT_SIGNATURE_TYPE_NONE
331+
depends on !BOOT_HW_KEY
332+
help
333+
MCUboot reads, from TLV, hash of a key that should be used to verify
334+
a signature and uses it to find a builtin key.
335+
This action is pointless when there is single key compiled in,
336+
as the signature verification process will just fail if that is not
337+
the right key.
338+
Enabling this option turns off key matching, slightly reducing
339+
MCUboot code and boot time.
340+
328341
config BOOT_SIGNATURE_KEY_FILE
329342
string "PEM key file"
330343
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
@@ -164,6 +164,15 @@
164164
#define MCUBOOT_HMAC_SHA512
165165
#endif
166166

167+
/* Turn off check of public key hash against compiled in key
168+
* before attempting signature verification. When there is only
169+
* one key, matching is pointless, the signature may just be
170+
* verified with the only key that there is.
171+
*/
172+
#ifdef CONFIG_BOOT_BYPASS_KEY_MATCH
173+
#define MCUBOOT_BYPASS_KEY_MATCH
174+
#endif
175+
167176
#ifdef CONFIG_BOOT_DECOMPRESSION
168177
#define MCUBOOT_DECOMPRESS_IMAGES
169178
#endif

0 commit comments

Comments
 (0)