Skip to content

[ARMORED] Improve hardening against multi-glitch corner cases - #844

Merged
dgarske merged 1 commit into
wolfSSL:masterfrom
danielinux:armored-hardening
Aug 5, 2026
Merged

[ARMORED] Improve hardening against multi-glitch corner cases#844
dgarske merged 1 commit into
wolfSSL:masterfrom
danielinux:armored-hardening

Conversation

@danielinux

Copy link
Copy Markdown
Member

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.

Copilot AI lite review requested due to automatic review settings August 5, 2026 16:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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/lock sha_ok arithmetically 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.

Comment thread include/image.h
Comment thread include/image.h
@dgarske
dgarske merged commit 9232a95 into wolfSSL:master Aug 5, 2026
406 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.

3 participants