Repository navigation
Size fast math mem-zero checks by the integer's digit count - #12068
Conversation
With ALT_ECC_SIZE, alt_fp_ints hold fewer digits than sizeof(a->dp), so the check ran into the next integer and aborted on wiped memory.
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the ECC memory-zero check changes.
No open issues 🎉
What changed in this PR
This PR fixes fast-math memory-zero checks for smaller ECC integers, preventing checks from extending beyond their digit storage and triggering false aborts.
Changes:
- Use the initialized digit count for memory-zero checks when
ALT_ECC_SIZEorHAVE_WOLF_BIGINTis enabled. - Skip NULL integers in memory-zero registration and checks.
- Add a Linux CI configuration combining fast math, alternate ECC sizing, and memory-zero checks.
| File | Description |
|---|---|
wolfcrypt/src/tfm.c |
Match check lengths to integer storage and guard against NULL integers. |
.github/configs/os-check-linux.json |
Add CI coverage for fast math with alternate ECC sizing and memory-zero checks. |
Review effort: Balanced
|
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #12068
Scan targets checked: wolfcrypt-src, wolfcrypt-bugs
Not reviewed (no scan target covers them): .github/configs/os-check-linux.json
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: Max
Description
With ALT_ECC_SIZE, alt_fp_ints hold fewer digits than sizeof(a->dp), so the check ran into the next integer and aborted on wiped memory.
They now use a->size, the same length fp_forcezero() wipes, and skip NULL integers. A NULL integer happens with ATECC/TA100 builds, where key->k is left unset.
Adds a fastmath-alt-ecc-check-mem-zero CI entry; this build aborts on master and passes with the fix.
Checklist