Skip to content

Fix explicit curve key poisoning of FP_ECC cache - #11880

Open
holtrop-wolfssl wants to merge 1 commit into
wolfSSL:masterfrom
holtrop-wolfssl:f-16243
Open

holtrop-wolfssl wants to merge 1 commit into
wolfSSL:masterfrom
holtrop-wolfssl:f-16243

Conversation

@holtrop-wolfssl

Copy link
Copy Markdown
Contributor

Description

Fix explicit curve key poisoning of FP_ECC cache

Fixes F-16243.

Testing

How did you test?

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

@holtrop-wolfssl holtrop-wolfssl self-assigned this Oct 23, 2026
Copilot AI balanced review requested due to automatic review settings October 23, 2026 18:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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 a and 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

@holtrop-wolfssl

Copy link
Copy Markdown
Contributor Author

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 wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants