Skip to content

Commit fc8477e

Browse files
nordicjmde-nordic
authored andcommitted
boot: bootutil: image_validate: Add error on security counter fail
Adds an error log output showing the version of the image security counter and the monotonic counter value when the image has too low a count to be booted Signed-off-by: Jamie McCrae <[email protected]>
1 parent d5f84b4 commit fc8477e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

boot/bootutil/src/image_validate.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -740,6 +740,8 @@ bootutil_img_validate(struct boot_loader_state *state,
740740
fih_rc = fih_ret_encode_zero_equality(img_security_cnt <
741741
(uint32_t)fih_int_decode(security_cnt));
742742
if (FIH_NOT_EQ(fih_rc, FIH_SUCCESS)) {
743+
BOOT_LOG_ERR("Image security counter value %u lower than monotonic value %u",
744+
img_security_cnt, (uint32_t)fih_int_decode(security_cnt));
743745
FIH_SET(fih_rc, FIH_FAILURE);
744746
goto out;
745747
}

0 commit comments

Comments
 (0)