Skip to content

Conversation

de-nordic
Copy link
Collaborator

Add MCUBOOT_CHECK_HEADER_LOAD_ADDRESS that allows to validate application image, against boot slot, with the use of ih_img_addr from header.

}

#if MCUBOOT_IMAGE_NUMBER > 1 && !defined(MCUBOOT_ENC_IMAGES) && defined(MCUBOOT_VERIFY_IMG_ADDRESS)
#if defined(MCUBOOT_VERIFY_IMG_ADDRESS) && !defined(MCUBOOT_ENC_IMAGES) || \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing bracket here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it is. I am still testing this locally and trying to make it run with sim.

#else
/* This is platform specific code that should not be here */
const uint32_t offset = secondary_hdr->ih_hdr_size + RESET_OFFSET;
BOOT_LOG_DBG("Getting image %d internal addr from offset %u",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would mark this as deprecated then remove it in 2 releases

Adding MCUBOOT_CHECK_HEADER_LOAD_ADDRESS that allows to verify
header stored ih_load_addr against target boot slot, to allow
MCUboot to reject firmware uploaded for incorrect slot.
This option works with encrypted software, as it does not require
decrypting image.
This option takes precedence over MCUBOOT_VERIFY_IMG_ADDRESS.
Note that the change leaves MCUBOOT_VERIFY_IMG_ADDRESS with the
bug reported here mcu-tools#2473.

This commit also removes dependency on having more then one image
to have the check enabled, as it makes no point to block using it
on single image.

Co-authored-by: Andrzej Puzdrowski <[email protected]>
Signed-off-by: Dominik Ermel <[email protected]>
Allows to enable MCUboot config MCUBOOT_CHECK_HEADER_LOAD_ADDRESS.

Co-authored-by: Andrzej Puzdrowski <[email protected]>
Signed-off-by: Dominik Ermel <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants