Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The context-wiping assertion cannot detect a missing wipe because the mocked cipher context stays zeroed; seed it with nonzero data before boot.
1 open issue
What changed in this PR
Hardens wolfBoot’s encrypted disk boot path by checking cipher errors and clearing sensitive state before handoff.
Changes:
- Checks AES initialization and disk decryption results.
- Rejects slots on cipher errors and wipes cipher contexts before boot.
- Adds failure-injection tests and a context-zeroization assertion.
| File | Description |
|---|---|
| tools/unit-tests/unit-update-disk.c | Adds cipher-error and cleanup checks. |
| src/update_disk.c | Handles decryption failures and clears cipher state. |
| src/libwolfboot.c | Checks AES initialization and key-setup errors. |
Review effort: Balanced
dgarske
force-pushed
the
disk_aes_checks
branch
from
December 3, 2026 22:23
f7caa07 to
b586d08
Compare
dgarske
requested review from
danielinux and
rizlik
and
a balanced review from Copilot
December 3, 2026 22:23
dgarske
force-pushed
the
disk_aes_checks
branch
from
December 3, 2026 23:04
b586d08 to
52b8cdf
Compare
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Missing AES backend sources and ChaCha-only disk mocks leave wc_AesFree safety after partial initialization, repeated golden-slot rekeying on hardware backends, and pre-handoff teardown requiring human validation.
No open issues 🎉
2 resolved since last review
Review effort: Balanced
dgarske
force-pushed
the
disk_aes_checks
branch
from
December 4, 2026 03:44
52b8cdf to
28be6dd
Compare
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.


Description
disk_crypto_set_iv()returns the cipher error, and a failed IV set or decrypt of a header or payload fails that slot and falls over to the other instead of going on to verification.aes_init()fails on awc_AesInitorwc_AesSetKeyDirecterror.Testing
unit-update-diskcovers an IV failure and a decrypt failure on one slot (falls over) and on both (fails closed), and checks the cipher context is zero at boot.