Skip to content

additional sanity checks on invalid input#10302

Merged
dgarske merged 5 commits into
wolfSSL:masterfrom
JacobBarthelmeh:ecc
May 7, 2026
Merged

additional sanity checks on invalid input#10302
dgarske merged 5 commits into
wolfSSL:masterfrom
JacobBarthelmeh:ecc

Conversation

@JacobBarthelmeh

@JacobBarthelmeh JacobBarthelmeh commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@JacobBarthelmeh JacobBarthelmeh self-assigned this Apr 24, 2026
Copilot AI review requested due to automatic review settings April 24, 2026 17:06

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.

Pull request overview

This PR adds additional input validation to ECC ECDSA sign/verify paths, treating an all-zero digest as invalid input and updating tests accordingly.

Changes:

  • Add “zero digest” rejection checks to software/SP ECC ECDSA sign/verify implementations (returning ECC_BAD_ARG_E).
  • Update the ECC test case that signs/verifies an all-zero digest to expect failures.
  • Remove the test-skip macro (WC_TEST_NO_ECC_SIGN_VERIFY_ZERO_DIGEST) from settings.h.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
wolfssl/wolfcrypt/settings.h Removes a hardware-specific test skip macro for ECC zero-digest sign/verify.
wolfcrypt/test/test.c Changes ECC sign/verify test logic to expect failure on all-zero digests.
wolfcrypt/src/sp_x86_64.c Adds early rejection for all-zero digests in SP sign/verify for P-256/384/521 (blocking + nonblocking).
wolfcrypt/src/sp_cortexm.c Same SP zero-digest rejection checks for Cortex-M SP implementation.
wolfcrypt/src/sp_c64.c Same SP zero-digest rejection checks for C64 SP implementation.
wolfcrypt/src/sp_c32.c Same SP zero-digest rejection checks for C32 SP implementation.
wolfcrypt/src/sp_armthumb.c Same SP zero-digest rejection checks for Arm Thumb SP implementation.
wolfcrypt/src/sp_arm64.c Same SP zero-digest rejection checks for Arm64 SP implementation.
wolfcrypt/src/sp_arm32.c Same SP zero-digest rejection checks for Arm32 SP implementation.
wolfcrypt/src/ecc.c Adds mp_iszero(e) checks in software sign/verify to return ECC_BAD_ARG_E.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread wolfssl/wolfcrypt/settings.h
Comment thread wolfcrypt/test/test.c
@github-actions

github-actions Bot commented Apr 24, 2026

Copy link
Copy Markdown

MemBrowse Memory Report

gcc-arm-cortex-m4

  • FLASH: .text +64 B (+0.0%, 197,429 B / 262,144 B, total: 75% used)

gcc-arm-cortex-m4-min-ecc

  • FLASH: .text +64 B (+0.1%, 60,155 B / 262,144 B, total: 23% used)

gcc-arm-cortex-m4-tls12

@JacobBarthelmeh JacobBarthelmeh force-pushed the ecc branch 3 times, most recently from 5b28299 to f762a42 Compare April 29, 2026 20:20
@JacobBarthelmeh

Copy link
Copy Markdown
Contributor Author

Retest this please Jenkins. The Generic config falcon flag test is not related but potentially some FIPS tests are.

@JacobBarthelmeh

JacobBarthelmeh commented Apr 30, 2026

Copy link
Copy Markdown
Contributor Author

Retest this please Jenkins. Visual studio build test "[tcp bind failed]"

@douzzer

douzzer commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

retest this please
(results lost)

@JacobBarthelmeh JacobBarthelmeh force-pushed the ecc branch 2 times, most recently from cec17ac to c28a605 Compare May 1, 2026 18:18
dgarske
dgarske previously approved these changes May 4, 2026
Comment thread .wolfssl_known_macro_extras
Comment thread .github/workflows/os-check.yml Outdated
@dgarske dgarske merged commit 58ca6a1 into wolfSSL:master May 7, 2026
440 of 443 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