Skip to content

Conversation

@de-nordic
Copy link
Collaborator

@de-nordic de-nordic commented Oct 22, 2025

Support in code for querying user provided function for an AES encryption key.

Extra Zephyr code and template that allows to use the new functionality.

Although I think this is ready for review I am still working, in different set of commits, on redefining encryption key type so that we could abstract that type across the MCUboot code; this means that this PR may change in how boot_take_enc_key function is defined.

Update: I will move imgtool script to separate PR, at this point. Fighting with FIH tests that from, what seems to be a timeout, without any feedback is impossible. Running personal docker is impossible either, because after getting authorized with docker registry I am denied access to required data anyway.

@de-nordic de-nordic force-pushed the aes-plain branch 3 times, most recently from daae031 to 5b663a9 Compare October 23, 2025 15:38
Copy link
Collaborator

@nvlsianpu nvlsianpu left a comment

Choose a reason for hiding this comment

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

changes in scripts/imgtool/image.py looks good.

@nvlsianpu nvlsianpu added crypto Encryption support area: core Affects core functionality area: zephyr Affects the Zephyr port labels Oct 28, 2025
@de-nordic de-nordic force-pushed the aes-plain branch 4 times, most recently from 28dc83c to 59f09d6 Compare November 5, 2025 20:30
Commit provides support for MCUBOOT_EMBEDDED_ENC_KEY config
option, that allows to compile code with embedded key.
When this option is enabled, compilation requires
definition of boot_take_enc_key function to be provided by user;
prototype for the function is provided.

The boot_take_enc_key function is supposed to provide encryption
AES key to be used for image encryption and decryption.

Signed-off-by: Dominik Ermel <[email protected]>
The commit provides Kconfig options that allow to configure
MCUboot to use embedded AES key. Primary option is
CONFIG_BOOT_ENCRYPT_IMAGE_WITH_EMBEDDED_KEY that allows to select
usage of embedded key in the code.
After it follow sets of Kconfigs:
 - CONFIG_BOOT_ENCRYPT_IMAGE_GENERATE_BASIC_KEY_PROVIDER
 - CONFIG_BOOT_ENCRYPT_IMAGE_USE_CUSTOM_KEY_PROVIDER

The above set allows to select source of the key. The first option
will choose to generate default key provider, with a single
embedded key, where the key is provided as a string assigned to
CONFIG_BOOOT_ENCRYPT_IMAGE_EMBEDDED_RAW_KEY.
The second option selects user provided code as source of key(s).

Signed-off-by: Dominik Ermel <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: core Affects core functionality area: zephyr Affects the Zephyr port crypto Encryption support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants