Skip to content

Commit

Permalink
boot: Add missing boot_enc_init
Browse files Browse the repository at this point in the history
The boot_enc_set_key in boot_swap_image, when recovering from
reset, has been caled on AES context that has not been
initialized.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
  • Loading branch information
de-nordic committed Jul 12, 2024
1 parent fb2cf0e commit caa8087
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions boot/bootutil/src/loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -1594,6 +1594,8 @@ boot_swap_image(struct boot_loader_state *state, struct boot_status *bs)
}
}

boot_enc_init(BOOT_CURR_ENC(state), slot);

if (i != BOOT_ENC_KEY_SIZE) {
boot_enc_set_key(BOOT_CURR_ENC(state), slot, bs);
}
Expand Down

0 comments on commit caa8087

Please sign in to comment.