Fix wolfCLU_sign_data_ecc and wolfCLU_verify_signature_ecc#219
Open
embhorn wants to merge 3 commits intowolfSSL:mainfrom
Open
Fix wolfCLU_sign_data_ecc and wolfCLU_verify_signature_ecc#219embhorn wants to merge 3 commits intowolfSSL:mainfrom
embhorn wants to merge 3 commits intowolfSSL:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR updates ECC signing and verification to hash the input message before calling wolfSSL’s ECDSA APIs, ensuring the functions operate on a digest rather than raw data and that sign/verify use consistent hashing by curve size.
Changes:
- Hash message input in
wolfCLU_sign_data_ecc()before callingwc_ecc_sign_hash(). - Hash message input in
wolfCLU_verify_signature_ecc()before callingwc_ecc_verify_hash(). - Select SHA-256/SHA-384/SHA-512 based on ECC key size for consistent sign/verify behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| src/sign-verify/clu_sign.c | Hashes input data prior to ECDSA signing and selects hash algorithm based on curve size. |
| src/sign-verify/clu_verify.c | Hashes input data prior to ECDSA verification and mirrors the signing hash selection logic. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced Apr 8, 2026
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.
src/sign-verify/clu_sign.c — wolfCLU_sign_data_ecc():
Before calling wc_ecc_sign_hash(), the input data is now hashed with a curve-appropriate algorithm (SHA-256 for P-256, SHA-384 for P-384, SHA-512 for P-521+). The digest is passed to wc_ecc_sign_hash() instead of the raw file contents.
src/sign-verify/clu_verify.c — wolfCLU_verify_signature_ecc() :
Same treatment — the raw message is hashed before being passed to wc_ecc_verify_hash(), using the same curve-size-based hash selection so sign and verify are consistent.
Fix some build errors with clang