From 7e3a1cecd73d30ee1e63e111344f03dd7a1b27ec Mon Sep 17 00:00:00 2001 From: Dominik Ermel Date: Fri, 12 Jul 2024 17:19:17 +0000 Subject: [PATCH] boot: Add missing boot_enc_init 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 --- boot/bootutil/src/loader.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/boot/bootutil/src/loader.c b/boot/bootutil/src/loader.c index ef1dfe89..d8ce649c 100644 --- a/boot/bootutil/src/loader.c +++ b/boot/bootutil/src/loader.c @@ -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); }