additional sanity checks on invalid input#10302
Open
JacobBarthelmeh wants to merge 1 commit intowolfSSL:masterfrom
Open
additional sanity checks on invalid input#10302JacobBarthelmeh wants to merge 1 commit intowolfSSL:masterfrom
JacobBarthelmeh wants to merge 1 commit intowolfSSL:masterfrom
Conversation
Contributor
There was a problem hiding this comment.
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) fromsettings.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.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related scripts change is here (https://github.com/wolfSSL/scripts/pull/573)