Skip to content

additional sanity checks on invalid input#10302

Open
JacobBarthelmeh wants to merge 1 commit intowolfSSL:masterfrom
JacobBarthelmeh:ecc
Open

additional sanity checks on invalid input#10302
JacobBarthelmeh wants to merge 1 commit intowolfSSL:masterfrom
JacobBarthelmeh:ecc

Conversation

@JacobBarthelmeh
Copy link
Copy Markdown
Contributor

@JacobBarthelmeh JacobBarthelmeh commented Apr 24, 2026

Related scripts change is here (https://github.com/wolfSSL/scripts/pull/573)

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

Copilot AI left a comment

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
Copy link
Copy Markdown

github-actions Bot commented Apr 24, 2026

MemBrowse Memory Report

gcc-arm-cortex-m4-baremetal

  • FLASH: .text +64 B (+0.1%, 64,371 B / 262,144 B, total: 25% used)

gcc-arm-cortex-m4-tls12

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.

2 participants