Commit 7e3a1cec authored by Dominik Ermel's avatar Dominik Ermel Committed by Andrzej Puzdrowski
Browse files

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: default avatarDominik Ermel <dominik.ermel@nordicsemi.no>
parent 4da4a72c
Loading
Loading
Loading
Loading
+2 −0
Changes for boot/bootutil/src/loader.c: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -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);
            }