Commit 3d77c959 authored by Fabio Utzig's avatar Fabio Utzig Committed by Fabio Utzig
Browse files

bootutil: fix broken bootstrap functionality

Fix bootstrap functionality which was broken by the fault injection
hardening support.

Signed-off-by: default avatarFabio Utzig <fabio.utzig@nordicsemi.no>
parent 3c9d5c45
Loading
Loading
Loading
Loading
+2 −2
Changes for boot/bootutil/src/loader.c: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -1636,11 +1636,11 @@ boot_prepare_image_for_update(struct boot_loader_state *state,

                if (rc == 0 || fih_not_eq(fih_rc, FIH_SUCCESS)) {

                    rc = boot_img_hdr(state, BOOT_SECONDARY_SLOT)->ih_magic == IMAGE_MAGIC;
                    rc = (boot_img_hdr(state, BOOT_SECONDARY_SLOT)->ih_magic == IMAGE_MAGIC) ? 1: 0;
                    FIH_CALL(boot_validate_slot, fih_rc,
                             state, BOOT_SECONDARY_SLOT, bs);

                    if (rc == 0 && fih_eq(fih_rc, FIH_SUCCESS)) {
                    if (rc == 1 && fih_eq(fih_rc, FIH_SUCCESS)) {
                        /* Set swap type to REVERT to overwrite the primary
                         * slot with the image contained in secondary slot
                         * and to trigger the explicit setting of the