Repository navigation
Conversation
|
@claude review |
|
There was a problem hiding this comment.
🟡 Changes recommended
The zeroization tests fail on supported allocator and math configurations and lack coverage for the newly added RSK and temporary-point digit wipes.
3 open issues
What changed in this PR
This PR strengthens SAKKE key cleanup in wolfCrypt by wiping secret-bearing storage before release and adding zeroization checks.
Changes:
- Securely wipe temporary integers, the receiver secret key point, and temporary points.
- Zero the entire
SakkeKeystructure after cleanup. - Add and register a test for structure zeroization and temporary heap-digit wiping.
| File | Description |
|---|---|
wolfcrypt/src/sakke.c |
Wipes secret-bearing storage during wc_FreeSakkeKey. |
tests/api/test_sakke.h |
Declares and registers the zeroization test. |
tests/api/test_sakke.c |
Adds zeroization assertions and allocator hooks for heap-digit checks. |
Review effort: Balanced
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #12000
Scan targets checked: wolfcrypt-src, wolfcrypt-bugs, wolfssl-bugs
Not reviewed (no scan target covers them): tests/api/test_sakke.h
Coverage: 1 of 2 in-scope changed file(s) opened by the reviewer; not opened: tests/api/test_sakke.c
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
There was a problem hiding this comment.
I reviewed this PR and didn't find any bugs. It changes key-teardown code in a crypto primitive, and the new test swaps out the global allocators, so a maintainer should still look at it.
What was reviewed:
wc_FreeSakkeKeyinwolfcrypt/src/sakke.c:mp_forcezero(heap math) wipes the used digits and then frees them, so it does everythingmp_freedid. TheForceZeroover the whole struct runs afterwc_ecc_free, and since it also clearsmpInitand the pointers, freeing the same key twice is still safe.wc_ecc_forcezero_pointis a public API that is always available, and the KMS and client SAKKE APIs the test calls are always defined, so the test needs no extra guards.- The allocator hooks in
test_wc_Sakke_FreeZeroizespass every call through to the previously installed allocators and put them back at the end. The digit buffers it watches cover only the used digits, which matches whatmp_forcezerowipes.
Extended reasoning...
The change hardens wc_FreeSakkeKey in wolfcrypt/src/sakke.c so it wipes the temporaries, the RSK and the scratch points, then zeroes the whole SakkeKey struct. It also adds a 172-line API test that installs wrapper allocators to check that the digit buffers are wiped when freed. The security-sensitive area is handling of secret key material in a crypto primitive. No bugs were found. I deferred instead of approving because the change touches crypto teardown code and the test changes global allocator state.
40ceff5 to
bbd6862
Compare
|
@claude review |
There was a problem hiding this comment.
🟡 Changes recommended
The new mp_iszero call causes tests/unit.test to fail to link in shared-library SAKKE builds using USE_FAST_MATH and hidden-symbol visibility without WOLFSSL_PUBLIC_MP.
1 open issue
3 resolved since last review
Review effort: Balanced
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #12000
Scan targets checked: wolfcrypt-src, wolfcrypt-bugs, wolfssl-bugs
Not reviewed (no scan target covers them): tests/api/test_sakke.h
Coverage: 2 of 2 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: Max


Description
Testing
Built --enable-all-crypto --enable-heapmath and passed test suite with updated tests.
Checklist