Extend mitigations against glitch injections#816
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends wolfBoot’s fault-injection/glitch hardening by adding redundant constant-time comparisons for critical hash checks and by hardening the firmware entry-point (“fw_base”) value used for the final boot jump.
Changes:
- Replace selected
image_CT_compare()call sites with a newwolfBoot_hardened_CT_compare()that repeats the comparison to resist single-fault instruction skips. - Introduce
wolfBoot_image_set_fw_base()to recordfw_basealongside its complement, and addFW_BASE_SANITY_CHECK()immediately beforedo_boot(). - Update image-opening/entry-setting paths to use the new
wolfBoot_image_set_fw_base()helper.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/update_flash.c | Uses hardened compare for delta base hash checks; uses wolfBoot_image_set_fw_base() and adds FW_BASE_SANITY_CHECK() before do_boot(). |
| src/image.c | Adds wolfBoot_hardened_CT_compare() and uses it for ELF scattered-image digest verification. |
| include/image.h | Adds not_fw_base, introduces wolfBoot_image_set_fw_base(), and defines FW_BASE_SANITY_CHECK() (no-op on non-armored builds). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #816
Scan targets checked: wolfboot-bugs, wolfboot-src
No new issues found in the changed files. ✅
dgarske
approved these changes
Jul 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
zd22067