Skip to content

Commit 5e6cffb

Browse files
committed
boot: boot_serial: Fix single slot encrypted image list
Fixes an issue whereby MCUboot is configured in single application slot mode with serial recovery with encryption and an encrypted image has been loaded, if valid this will have been decrypted, so should not be treated as encrypted Signed-off-by: Jamie McCrae <[email protected]>
1 parent 3f0b89d commit 5e6cffb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

boot/boot_serial/src/boot_serial.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,10 +294,12 @@ bs_list(char *buf, int len)
294294
if (FIH_EQ(fih_rc, FIH_BOOT_HOOK_REGULAR))
295295
{
296296
#if defined(MCUBOOT_ENC_IMAGES)
297+
#if !defined(MCUBOOT_SINGLE_APPLICATION_SLOT)
297298
if (IS_ENCRYPTED(&hdr) && MUST_DECRYPT(fap, image_index, &hdr)) {
298299
FIH_CALL(boot_image_validate_encrypted, fih_rc, fap,
299300
&hdr, tmpbuf, sizeof(tmpbuf));
300301
} else {
302+
#endif
301303
if (IS_ENCRYPTED(&hdr)) {
302304
/*
303305
* There is an image present which has an encrypted flag set but is
@@ -310,7 +312,7 @@ bs_list(char *buf, int len)
310312

311313
FIH_CALL(bootutil_img_validate, fih_rc, NULL, 0, &hdr,
312314
fap, tmpbuf, sizeof(tmpbuf), NULL, 0, NULL);
313-
#if defined(MCUBOOT_ENC_IMAGES)
315+
#if defined(MCUBOOT_ENC_IMAGES) && !defined(MCUBOOT_SINGLE_APPLICATION_SLOT)
314316
}
315317
#endif
316318
}

0 commit comments

Comments
 (0)