You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The MUST_DECRYPT() macro seems to determine if decryption is necessary, by checking if the image is in the second slot. Since we do not have a second slot in a single slot application, the macro FLASH_AREA_IMAGE_SECONDARY() will return the index of the first slot and is therefore always true.
A possible fix could be to only use MUST_DECRYPT if we are not in a single slot setup:
if (IS_ENCRYPTED(&hdr) && (MUST_DECRYPT(fap, image_index, &hdr) && !MCUBOOT_SINGLE_APPLICATION_SLOT)) {
...
On the other hand, I do not exactly understand why the encrypted-flags in the image header are set at that point. The image in this scenario was decrypted in-place right after it was uploaded by serial recovery. Shouldn't the header also get updated with cleared encrypted-flags once it is decrypted? I do not exactly know how MCUboot is intended to work, so maybe that is intentional for some reason I do not see...
The text was updated successfully, but these errors were encountered:
Problem
In serial recovery, the image list command does not list encrypted images if only one slot is used (MCUBOOT_SINGLE_APPLICATION_SLOT)
Cause
A similar Issue #1753 was fixed by #1747, but the added check
&& MUST_DECRYPT(...)
does not work for single slot applications.boot_serial.c @ L297
The
MUST_DECRYPT()
macro seems to determine if decryption is necessary, by checking if the image is in the second slot. Since we do not have a second slot in a single slot application, the macroFLASH_AREA_IMAGE_SECONDARY()
will return the index of the first slot and is therefore always true.image.h @ L160
Possible Fix
A possible fix could be to only use
MUST_DECRYPT
if we are not in a single slot setup:On the other hand, I do not exactly understand why the encrypted-flags in the image header are set at that point. The image in this scenario was decrypted in-place right after it was uploaded by serial recovery. Shouldn't the header also get updated with cleared encrypted-flags once it is decrypted? I do not exactly know how MCUboot is intended to work, so maybe that is intentional for some reason I do not see...
The text was updated successfully, but these errors were encountered: