Skip to content

mcuboot: support multiple signing keys#1

Open
JPHutchins wants to merge 1 commit into
mainfrom
mcuboot/multiple-signing-keys
Open

mcuboot: support multiple signing keys#1
JPHutchins wants to merge 1 commit into
mainfrom
mcuboot/multiple-signing-keys

Conversation

@JPHutchins
Copy link
Copy Markdown
Collaborator

Draft integration for mcu-tools/mcuboot#2701

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 18, 2026

The following west manifest projects have changed revision in this Pull Request:

Name Old Revision New Revision Diff
mcuboot intercreate/mcuboot@511dc9e intercreate/mcuboot@feature-zephyr-multiple-signing-keys intercreate/mcuboot@511dc9e2..feature-zephyr-multiple-signing-keys

Additional metadata changed:

Name URL Submodules West cmds module.yml Blobs
mcuboot

DNM label due to: 1 project with metadata changes

Note: This message is automatically posted and updated by the Manifest GitHub Action.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Draft integration of MCUboot “multiple signing keys” support into Zephyr’s sysbuild flow, including new Kconfig/CMake plumbing, documentation, and a sample demonstrating the dual-key verification use case.

Changes:

  • Switch MCUboot module source to a fork/branch carrying the multi-key feature.
  • Add *_KEY_FILE_2 support across sysbuild Kconfig/CMake and expose it to app configuration.
  • Add a new sysbuild sample + docs/release-notes updates and a new test scenario.

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
west.yml Points MCUboot module to a fork/feature branch for the multi-key work.
tests/boot/test_mcuboot/testcase.yaml Adds a new test variant enabling the second key setting.
tests/boot/test_mcuboot/root-ed25519-2.pem Adds an ED25519 key file used by the new test variant.
share/sysbuild/images/bootloader/Kconfig Introduces BOOT_SIGNATURE_KEY_FILE_2 and clarifies key path semantics.
share/sysbuild/images/bootloader/CMakeLists.txt Normalizes signing key paths (incl. second key) before passing to MCUboot image.
share/sysbuild/image_configurations/MAIN_image_default.cmake Forwards second key path into main app Kconfig (CONFIG_MCUBOOT_SIGNATURE_KEY_FILE_2).
share/sysbuild/image_configurations/FIRMWARE_LOADER_image_default.cmake Forwards second key path into firmware-loader app Kconfig.
scripts/ci/check_compliance.py Allows the new Kconfig symbol in compliance checks.
samples/sysbuild/mcuboot_dual_key/sysbuild/mcuboot.conf Sample-specific MCUboot config fragment.
samples/sysbuild/mcuboot_dual_key/sysbuild.conf Sysbuild configuration demonstrating dual accepted verification keys.
samples/sysbuild/mcuboot_dual_key/src/main.c Minimal app used by the new sysbuild sample.
samples/sysbuild/mcuboot_dual_key/sample.yaml Adds test definition for the new sample.
samples/sysbuild/mcuboot_dual_key/prj.conf Placeholder application config for the sample.
samples/sysbuild/mcuboot_dual_key/keys/prod_pubkey.pem Public-only PEM embedded as the “production” verification key in the sample.
samples/sysbuild/mcuboot_dual_key/README.rst End-to-end documentation for the dual-key sysbuild sample.
samples/sysbuild/mcuboot_dual_key/CMakeLists.txt Sysbuild-enabled sample CMake wiring.
modules/Kconfig.mcuboot Adds MCUBOOT_SIGNATURE_KEY_FILE_2 to expose the second key path to app builds.
doc/releases/release-notes-4.5.rst Release note entry for the new sysbuild option and sample.
doc/build/signing/index.rst Documents SB_CONFIG_BOOT_SIGNATURE_KEY_FILE_2 in the signing guide.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/boot/test_mcuboot/root-ed25519-2.pem Outdated
Comment thread samples/sysbuild/mcuboot_dual_key/README.rst Outdated
Comment thread west.yml
Comment thread tests/boot/test_mcuboot/testcase.yaml Outdated
@JPHutchins
Copy link
Copy Markdown
Collaborator Author

Good results by following the readme!

*** Using Zephyr OS build v4.4.0-3680-g5598d5b364cc ***
I: Starting bootloader
D: context_boot_go
I: Image index: 0, Swap type: none
D: boot_validate_slot: slot 0, expected_swap_type 0
D: bootutil_img_validate: flash area 0x8680
D: bootutil_img_hash
D: bootutil_tlv_iter_begin: type 65535, prot == 0
D: bootutil_img_validate: TLV off 25816, end 25956
D: bootutil_tlv_iter_next: searching for 65535 (65535 is any) starting at 25816 ending at 25956
D: bootutil_tlv_iter_next: TLV 16 found at 25820 (size 32)
D: bootutil_img_validate: EXPECTED_HASH_TLV == 16
D: bootutil_tlv_iter_next: searching for 65535 (65535 is any) starting at 25852 ending at 25956
D: bootutil_tlv_iter_next: TLV 1 found at 25856 (size 32)
D: bootutil_img_validate: EXPECTED_KEY_TLV == 1
D: bootutil_find_key
D: bootutil_tlv_iter_next: searching for 65535 (65535 is any) starting at 25888 ending at 25956
D: bootutil_tlv_iter_next: TLV 36 found at 25892 (size 64)
D: bootutil_img_validate: EXPECTED_SIG_TLV == 36
D: bootutil_verify_sig: ED25519 key_id 0
D: bootutil_tlv_iter_next: searching for 65535 (65535 is any) starting at 25956 ending at 25956
D: bootutil_tlv_iter_next: TLV 65535 not found
D: Left boot_go with success == 1
I: Bootloader chainload address offset: 0xc000
I: Image version: v0.0.0
I: Jumping to the first image slot
*** Booting Zephyr OS build v4.4.0-3680-g5598d5b364cc ***
[00:00:00.005,096] <inf> app: Address of sample 0xc000
[00:00:00.010,589] <inf> app: Hello mcuboot signing keys! nrf52840dk
*** Using Zephyr OS build v4.4.0-3680-g5598d5b364cc ***
I: Starting bootloader
D: context_boot_go
I: Image index: 0, Swap type: none
D: boot_validate_slot: slot 0, expected_swap_type 0
D: bootutil_img_validate: flash area 0x8680
D: bootutil_img_hash
D: bootutil_tlv_iter_begin: type 65535, prot == 0
D: bootutil_img_validate: TLV off 25816, end 25956
D: bootutil_tlv_iter_next: searching for 65535 (65535 is any) starting at 25816 ending at 25956
D: bootutil_tlv_iter_next: TLV 16 found at 25820 (size 32)
D: bootutil_img_validate: EXPECTED_HASH_TLV == 16
D: bootutil_tlv_iter_next: searching for 65535 (65535 is any) starting at 25852 ending at 25956
D: bootutil_tlv_iter_next: TLV 1 found at 25856 (size 32)
D: bootutil_img_validate: EXPECTED_KEY_TLV == 1
D: bootutil_find_key
D: bootutil_tlv_iter_next: searching for 65535 (65535 is any) starting at 25888 ending at 25956
D: bootutil_tlv_iter_next: TLV 36 found at 25892 (size 64)
D: bootutil_img_validate: EXPECTED_SIG_TLV == 36
D: bootutil_verify_sig: ED25519 key_id 1
D: bootutil_tlv_iter_next: searching for 65535 (65535 is any) starting at 25956 ending at 25956
D: bootutil_tlv_iter_next: TLV 65535 not found
D: Left boot_go with success == 1
I: Bootloader chainload address offset: 0xc000
I: Image version: v0.0.0
I: Jumping to the first image slot
*** Booting Zephyr OS build v4.4.0-3680-g5598d5b364cc ***
[00:00:00.005,065] <inf> app: Address of sample 0xc000
[00:00:00.010,559] <inf> app: Hello mcuboot signing keys! nrf52840dk
*** Using Zephyr OS build v4.4.0-3680-g5598d5b364cc ***
I: Starting bootloader
D: context_boot_go
I: Image index: 0, Swap type: none
D: boot_validate_slot: slot 0, expected_swap_type 0
D: bootutil_img_validate: flash area 0x8680
D: bootutil_img_hash
D: bootutil_tlv_iter_begin: type 65535, prot == 0
D: bootutil_img_validate: TLV off 25816, end 25956
D: bootutil_tlv_iter_next: searching for 65535 (65535 is any) starting at 25816 ending at 25956
D: bootutil_tlv_iter_next: TLV 16 found at 25820 (size 32)
D: bootutil_img_validate: EXPECTED_HASH_TLV == 16
D: bootutil_tlv_iter_next: searching for 65535 (65535 is any) starting at 25852 ending at 25956
D: bootutil_tlv_iter_next: TLV 1 found at 25856 (size 32)
D: bootutil_img_validate: EXPECTED_KEY_TLV == 1
D: bootutil_find_key
D: bootutil_tlv_iter_next: searching for 65535 (65535 is any) starting at 25888 ending at 25956
D: bootutil_tlv_iter_next: TLV 36 found at 25892 (size 64)
D: bootutil_img_validate: EXPECTED_SIG_TLV == 36
D: bootutil_tlv_iter_next: searching for 65535 (65535 is any) starting at 25956 ending at 25956
D: bootutil_tlv_iter_next: TLV 65535 not found
E: Image in the primary slot is not valid!
D: Left boot_go with success == 0
E: Unable to find bootable image
*** Using Zephyr OS build v4.4.0-3680-g5598d5b364cc ***
I: Starting bootloader
D: context_boot_go
I: Image index: 0, Swap type: none
D: boot_validate_slot: slot 0, expected_swap_type 0
D: bootutil_img_validate: flash area 0x8680
D: bootutil_img_hash
D: bootutil_tlv_iter_begin: type 65535, prot == 0
D: bootutil_img_validate: TLV off 25816, end 25956
D: bootutil_tlv_iter_next: searching for 65535 (65535 is any) starting at 25816 ending at 25956
D: bootutil_tlv_iter_next: TLV 16 found at 25820 (size 32)
D: bootutil_img_validate: EXPECTED_HASH_TLV == 16
D: bootutil_tlv_iter_next: searching for 65535 (65535 is any) starting at 25852 ending at 25956
D: bootutil_tlv_iter_next: TLV 1 found at 25856 (size 32)
D: bootutil_img_validate: EXPECTED_KEY_TLV == 1
D: bootutil_find_key
D: bootutil_tlv_iter_next: searching for 65535 (65535 is any) starting at 25888 ending at 25956
D: bootutil_tlv_iter_next: TLV 36 found at 25892 (size 64)
D: bootutil_img_validate: EXPECTED_SIG_TLV == 36
D: bootutil_verify_sig: ED25519 key_id 0
D: bootutil_tlv_iter_next: searching for 65535 (65535 is any) starting at 25956 ending at 25956
D: bootutil_tlv_iter_next: TLV 65535 not found
D: Left boot_go with success == 1
I: Bootloader chainload address offset: 0xc000
I: Image version: v0.0.0
I: Jumping to the first image slot
*** Booting Zephyr OS build v4.4.0-3680-g5598d5b364cc ***
[00:00:00.005,096] <inf> app: Address of sample 0xc000
[00:00:00.010,589] <inf> app: Hello mcuboot signing keys! nrf52840dk

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated 3 comments.

Comment on lines +32 to +34
--slot-size=${slot_size}
--overwrite-only
--align=1
--key=${ZEPHYR_MCUBOOT_MODULE_DIR}/root-ed25519-2.pem
${image}.hex ${image}.signed.prod.hex
COMMAND ${imgtool_sign}
--key=${ZEPHYR_MCUBOOT_MODULE_DIR}/root-ed25519-unknown.pem
Comment on lines +22 to +24
# and resolve relative entries against the main application directory, so an
# application can ship keys under its own source tree and reference them by
# relative path -- the same resolution cmake/mcuboot.cmake performs app-side.
Draft commit.

Signed-off-by: JP Hutchins <jp@intercreate.io>
@JPHutchins JPHutchins force-pushed the mcuboot/multiple-signing-keys branch from 6ea44fe to 5c070ce Compare June 1, 2026 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants