Skip to content

Conversation

@danielinux
Copy link
Member

@danielinux danielinux commented Nov 21, 2024

Only allow delta update if the sha digest of the base image matches the expected value. This is to prevent the delta update from being applied to an image that is not the expected base image, even if the version matches.

The mismatch should never happen in real-life scenarios, but it is adviseable to check for false positives during integration, testing and development.

Only allow delta update if the sha digest of the base image matches the
expected value. This is to prevent the delta update from being applied
to an image that is not the expected base image, even if the version
matches.

The mismatch should never happen in real-life scenarios, but it is to check
for false positives during integration, testing and development.
delta_base_v = wolfBoot_get_diffbase_version(PART_UPDATE);

if (delta_base_hash_sz != WOLFBOOT_SHA_DIGEST_SIZE) {
wolfBoot_printf("Delta update: Base hash size mismatch"
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we have some type of backwards compatibility when the delta_base_v is not found? Delta update: Base hash size mismatch (size: 0 expected 20)

git checkout master
git distclean
make distclean
cp config/examples/sim-delta-update.config .config
make -C tools/keytools && make -C tools/bin-assemble
make clean && make test-sim-internal-flash-with-delta-update
git checkout delta-base-hash
make wolfboot.elf
./wolfboot.elf update_trigger get_version
./wolfboot.elf success get_version

Copy link
Member Author

Choose a reason for hiding this comment

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

Done. Also added a (documented) option --no-base-sha for sign.
No SHA is not fatal now for wolfBoot.
Also added a test to prove that.

+ Added --no-base-sha option to sign
@danielinux danielinux requested a review from dgarske November 22, 2024 11:08
@dgarske dgarske merged commit 2cdc1f5 into wolfSSL:master Nov 22, 2024
101 checks passed
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