Repository navigation
Conversation
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #11561
Scan targets checked: wolfcrypt-src, wolfcrypt-bugs, wolfssl-src, wolfssl-bugs
Coverage: 1 of 3 in-scope changed file(s) opened by the reviewer; not opened: wolfcrypt/test/test.c, wolfssl/wolfcrypt/memory.h
Fenrir result: Approved ✅
No new issues found in the changed files.
Advisory only — this automated result does not count as a GitHub approval.
Review tier: Lite
|
8f994e9 to
7e9d1ae
Compare
|
Jenkins retest this please |
7e9d1ae to
6fd42cf
Compare
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #11561
Scan targets checked: wolfcrypt-src, wolfcrypt-bugs, wolfssl-src, wolfssl-bugs
Coverage: 1 of 1 in-scope changed file(s) opened by the reviewer
Findings: 1
1 finding(s) posted as inline comments (see file-level comments below)
This review was generated automatically by Fenrir. Reported findings require changes before merge.
Review tier: Lite
6fd42cf to
4690a0d
Compare
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #11561
Scan targets checked: wolfcrypt-src, wolfcrypt-bugs, wolfssl-src, wolfssl-bugs
Coverage: 5 of 10 in-scope changed file(s) opened by the reviewer; not opened: wolfcrypt/src/blake2b.c, wolfcrypt/src/blake2s.c, wolfcrypt/src/memory.c, wolfssl/wolfcrypt/blake2-impl.h, wolfssl/wolfcrypt/memory.h
Fenrir result: Approved ✅
No new issues found in the changed files.
Advisory only — this automated result does not count as a GitHub approval.
Review tier: Lite
Fenrir's latest completed scan found no issues; clearing the prior automated change request.
4690a0d to
8da59b5
Compare
|
This PR is also moving ForceZero to wc_port: |
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
Secure wiping and compiler-barrier changes span toolchains and architectures that need platform-level validation.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
This PR fixes negative-length comparisons in wolfCrypt. It also changes secure wiping and compiler barriers across supported platforms.
Changes:
- Return a positive result for negative comparison lengths and add tests.
- Revise secure wiping, compiler barriers, and the location of exported helper functions.
- Update feature guards and release notes.
| File | Description |
|---|---|
wolfssl/wolfcrypt/wc_port.h |
Declares helpers and revises barrier macros. |
wolfssl/wolfcrypt/settings.h |
Preserves wiping for BLAKE2 and Argon2. |
wolfssl/wolfcrypt/memory.h |
Removes relocated helper declarations. |
wolfssl/wolfcrypt/blake2-impl.h |
Removes the old wiping helper. |
wolfcrypt/test/test.h |
Declares the comparison test. |
wolfcrypt/test/test.c |
Tests comparison results and boundaries. |
wolfcrypt/src/wc_port.c |
Houses exported helpers and the portable barrier sink. |
wolfcrypt/src/misc.c |
Rejects negative lengths and revises wiping. |
wolfcrypt/src/memory.c |
Removes relocated helper implementations. |
wolfcrypt/src/blake2s.c |
Uses ForceZero for key material. |
wolfcrypt/src/blake2b.c |
Uses ForceZero for key material. |
ChangeLog.md |
Records behavioral and compatibility changes. |
.wolfssl_known_macro_extras |
Registers the new barrier macro. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
This pr is branched off of #10935 |
fec73b0 to
6c8bc3e
Compare
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #11561
Scan targets checked: wolfcrypt-src, wolfcrypt-bugs, wolfssl-src, wolfssl-bugs
Coverage: 1 of 1 in-scope changed file(s) opened by the reviewer
Fenrir result: Approved ✅
No new issues found in the changed files.
Advisory only — this automated result does not count as a GitHub approval.
Review tier: Lite
3441191 to
709a9c0
Compare
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #11561
Scan targets checked: wolfcrypt-src, wolfcrypt-bugs, wolfssl-src, wolfssl-bugs
Coverage: 1 of 1 in-scope changed file(s) opened by the reviewer
Fenrir result: Approved ✅
No new issues found in the changed files.
Advisory only — this automated result does not count as a GitHub approval.
Review tier: Lite
709a9c0 to
c889b3c
Compare
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #11561
Scan targets checked: wolfcrypt-src, wolfcrypt-bugs, wolfssl-src, wolfssl-bugs
Coverage: 1 of 3 in-scope changed file(s) opened by the reviewer; not opened: wolfcrypt/test/test.c, wolfssl/wolfcrypt/wc_port.h
Fenrir result: Approved ✅
No new issues found in the changed files.
Advisory only — this automated result does not count as a GitHub approval.
Review tier: Lite
c889b3c to
4451775
Compare
|
Removed ConstantCompare()'s base from ForceZero. |
Returning 0 for a negative length reported "equal" for a comparison that never ran. The sentinel is positive because AES_GCM_decrypt_C() folds this return into a mask that reads a negative value as a match.
4451775 to
5651758
Compare
|
@claude review |
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #11561
Scan targets checked: wolfcrypt-src, wolfcrypt-bugs, wolfssl-src, wolfssl-bugs
Not reviewed (no scan target covers them): ChangeLog.md, wolfcrypt/test/test.h
Coverage: 4 of 4 in-scope changed file(s) opened by the reviewer
Fenrir result: Approved ✅
No new issues found in the changed files.
Advisory only — this automated result does not count as a GitHub approval.
Review tier: Lite


Description
ConstantCompare() and wc_ConstantCompare() returned 0 (equal) for a negative length, so a caller whose length arithmetic underflowed got a false match. They now return 1. length == 0 still returns 0.
The value is positive because callers such as AES_GCM_decrypt_C() build constant-time masks that read a negative value as a match.
Adds constantcompare_test() to wolfCrypt's test suite.
Checklist