Skip to content

Size fast math mem-zero checks by the integer's digit count - #12068

Merged
JacobBarthelmeh merged 1 commit into
wolfSSL:masterfrom
stenslae:fix/ecc-alt-size-memzero
Nov 9, 2026
Merged

JacobBarthelmeh merged 1 commit into
wolfSSL:masterfrom
stenslae:fix/ecc-alt-size-memzero

Conversation

@stenslae

@stenslae stenslae commented Nov 9, 2026

Copy link
Copy Markdown
Member

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

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

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.
@stenslae stenslae self-assigned this Nov 9, 2026
Copilot AI balanced review requested due to automatic review settings November 9, 2026 19:16

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.

🟢 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_SIZE or HAVE_WOLF_BIGINT is 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

@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

@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 #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

@stenslae stenslae assigned wolfSSL-Bot and unassigned stenslae Nov 9, 2026
@JacobBarthelmeh
JacobBarthelmeh merged commit 0570d77 into wolfSSL:master Nov 9, 2026
441 checks passed
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.

5 participants