Skip to content

Conversation

@de-nordic
Copy link
Collaborator

PR adds boot_state_init that is intended to be used for boot_loader_state object initialization.
The boot_state_init is then used in places where boot_state_clear has been previously used for state initialization and paired with boot_state_clear to cleanup state when it is no longer used.

@de-nordic de-nordic force-pushed the inits-and-deinits branch 2 times, most recently from 2a8e7fa to 2420ff6 Compare October 28, 2025 16:32
boot_loader_state initialization function.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Replace boot_state_clear with boot_state_init, where used
for initialization and add boot_state_clear to remove state
after use.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Initialize boot_loader_state with boot_state init, then clean
it up, after use, with boot_state_clear.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
No need to keep this defaulting logic.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Call boot_enc_deinit before memset to 0.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
#if defined(MCUBOOT_ENC_IMAGES)
for (image = 0; image < BOOT_IMAGE_NUMBER; ++image) {
for (slot = 0; slot < BOOT_NUM_SLOTS; ++slot) {
boot_enc_init(&state->enc[image][slot]);
Copy link
Collaborator

Choose a reason for hiding this comment

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

whatever was pointed by state get zeroized already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants