-
Notifications
You must be signed in to change notification settings - Fork 773
Add support for multiple same-type signatures with key ID parsing #2305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Please update
signature
the data member of Image class tosignatures
.
6ce6e96
to
e0027a2
Compare
8301988
to
9322025
Compare
9322025
to
291cf66
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Until the PR mcu-tools/mcuboot#2305 is merged, apply the added patches to support multiple signatures in mcuboot. Signed-off-by: Maulik Patel <maulik.patel@arm.com> Change-Id: Id8e62b7f332611858508bd445fab99fd7c0259ab
By default MCUBOOT_IMAGE_MULTI_SIG_SUPPORT is set to OFF, maintaining the existing single-signature behavior. When enabled, RSE secure image is also signed with additional ROTPK key. And both the signaures are verified during boot. This patch works with changes to mcuboot for multi-signature support (PR: mcu-tools/mcuboot#2305) Signed-off-by: Maulik Patel <maulik.patel@arm.com> Change-Id: Ic72d1dcfa3f3ada6c4d275281122f6d919a2d8e1
When MCUBOOT_BUILTIN_KEY is enabled, the key id TLV entry is added to the image. Parse this entry while validating the image to identify the key used to sign the image. This enables future support for scenarios such as multiple built-in keys or multi-signature. Signed-off-by: Maulik Patel <maulik.patel@arm.com> Change-Id: Ibe26bc2b09e63350f4214719606a5aa4bc1be93c
This patch adds support for multiple signatures to single image. This is useful for scenarios where multiple keys are used to sign images, allowing for greater flexibility and security in the image verification process. The tool command line interface is extended to support multiple signatures. The imgtool test suite is updated to test the new functionality. Change-Id: I285b426671f6ad76472f0a2f8fb3a330f8882c3d Signed-off-by: Maulik Patel <maulik.patel@arm.com>
291cf66
to
6b64341
Compare
Until the PR mcu-tools/mcuboot#2305 is merged, apply the added patches to support multiple signatures in mcuboot. Signed-off-by: Maulik Patel <maulik.patel@arm.com> Change-Id: Id8e62b7f332611858508bd445fab99fd7c0259ab
By default MCUBOOT_IMAGE_MULTI_SIG_SUPPORT is set to OFF, maintaining the existing single-signature behavior. When enabled, RSE secure image is also signed with additional ROTPK key. And both the signaures are verified during boot. This patch works with changes to mcuboot for multi-signature support (PR: mcu-tools/mcuboot#2305) Signed-off-by: Maulik Patel <maulik.patel@arm.com> Change-Id: Ic72d1dcfa3f3ada6c4d275281122f6d919a2d8e1
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. The image_validate.c file is refactored such that: * bootutil_find_key() find the key is moved to a new file bootutil_find_key.c. * bootutil_image_hash() is moved to a new file bootutil_image_hash.c. * bootutil_img_security_cnt() is moved to a new file bootutil_img_security_cnt.c. This allows common validation code to be reused for multiple signatures. All code specific to multi sign is under the option 'MCUBOOT_IMAGE_MULTI_SIG_SUPPORT'. Furthermore, key id type is updated to uint32_t as per PSA crypto spec. Signed-off-by: Maulik Patel <maulik.patel@arm.com> Change-Id: I05c97ac385c5816c812c51feb010028df8412fe5
Since the key id concept in the PSA specific, rename the variables accordingly. Signed-off-by: Maulik Patel <maulik.patel@arm.com> Change-Id: I8a8a5ceba5554211f185cc4045a6081b6d407507
6b64341
to
92e6949
Compare
Thank you @maulik-arm for all the updates! |
@maulik-arm I forgot to ask you to add a release note snippet for this major change. |
This PR adds support for signing and verifying images with multiple signatures of the same type (e.g., multiple EC256 signatures), enhancing flexibility in secure boot scenarios. It also introduces Key ID TLV parsing to enable the bootloader to select the correct key from a set of built-in keys.
Motivation
Previously, MCUboot only allowed a single signature per image per signature type. This limited use cases where multiple stakeholders need to sign the same image or when fallback keys are required.
This PR removes that limitation by allowing multiple signatures of the same type.
Use Cases
Changes Included
1. bootutil: Parse key ID TLV for built-in keys
MCUBOOT_BUILTIN_KEY
is enabled.2. imgtool: Add support for multiple signatures and key ID TLVs
--key
arguments.3. bootutil: Add support for verifying multiple same-type signatures
MCUBOOT_BUILTIN_KEY
orMCUBOOT_HW_KEY
is enabled, the key ID is used to select the appropriate key for verification.Notes