Repository navigation
Fix explicit curve key poisoning of FP_ECC cache - #11880
holtrop-wolfssl wants to merge 1 commit into
Conversation
Fixes F-16243.
There was a problem hiding this comment.
🔵 Needs a closer look
The security-sensitive cache change needs runtime validation across supported math backends and allocation-failure paths before approval.
No open issues 🎉
What changed in this PR
This PR addresses FP_ECC cache poisoning by ensuring cached point-multiplication tables are reused only when both the base point and curve parameters match.
Changes:
- Include curve parameter
aand the modulus in cache identity, with cleanup for both stored values. - Update multiplication callers and white-box tests for curve-aware cache matching.
- Add an API regression test that checks correct multiplication after warming the cache with a different curve parameter.
| File | Description |
|---|---|
| wolfcrypt/src/ecc.c | Store, compare, and release curve parameters in FP_ECC cache entries. |
| tests/unit-mcdc/test_ecc_whitebox.c | Check cache misses for mismatched curve parameters. |
| tests/unit-mcdc/test_ecc_fault_whitebox.c | Update cache helper calls and partial-match coverage. |
| tests/api/test_ecc.c | Add a regression test for cross-curve cache poisoning. |
Review effort: Balanced
|
After discussing with Kareem, we had duplicated some work here. We're planning to go with his PR on this instead: #11852 |
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #11880
Scan targets checked: wolfcrypt-src, wolfcrypt-bugs, wolfssl-bugs
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: Max
Description
Fix explicit curve key poisoning of FP_ECC cache
Fixes F-16243.
Testing
How did you test?
Checklist