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 <dominik.ermel@nordicsemi.no>
This commit is contained in:
Dominik Ermel 2024-07-12 17:19:17 +00:00 committed by Andrzej Puzdrowski
parent 4da4a72cb1
commit 7e3a1cecd7
1 changed files with 2 additions and 0 deletions

View File

@ -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);
}