[ARMORED] Improve hardening against multi-glitch corner cases - #844
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR strengthens fault-injection hardening in the ARMORED verification path by making constant-time digest comparisons more resistant to instruction-skip glitches and by binding sha_ok to a comparison “witness” value rather than to control flow.
Changes:
- Add an ARMORED-specific
image_CT_compare()variant using a sentinel accumulator and multiple post-loop witnesses. - Introduce a call-free inline digest comparison gate (
CT_COMPARE_INLINE) as an additional check during integrity verification. - Add
wolfBoot_image_seal_sha_ok()to derive/locksha_okarithmetically from the witness produced by the comparison.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/image.c | Adds ARMORED-hardened constant-time compare implementation and updates hardened compare wording/semantics. |
| include/image.h | Adds witness-based sha_ok sealing and an inline (call-free) digest comparison gate integrated into integrity verification. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
danielinux
force-pushed
the
armored-hardening
branch
from
August 5, 2026 18:24
036e9cc to
31f0168
Compare
dgarske
approved these changes
Aug 5, 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.
Harden image_CT_compare() against multiple instruction skips, add a call-free inline digest gate, and derive sha_ok arithmetically from the witness the comparison produces.