Repository navigation
PSA: zero extend r and s in ECC verify callback - #12401
Open
padelsbach wants to merge 1 commit into
Open
padelsbach wants to merge 1 commit into
padelsbach wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the PSA ECDSA signature-padding change.
No open issues 🎉
What changed in this PR
Fixes intermittent PSA ECDSA verification failures by padding signature components to the curve size, addressing F-7430.
Changes:
- Zero-pads
randsbefore passing signatures to PSA. - Adds regression tests for short components, an incorrect digest, and an oversized component.
| File | Description |
|---|---|
wolfcrypt/src/port/psa/psa_pkcbs.c |
Returns the curve size and uses it to pad signature components. |
tests/api/test_ssl_pk.h |
Registers the PSA verification test. |
tests/api/test_ssl_pk.c |
Adds signature-padding and rejection test cases. |
Review effort: Balanced
|
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.
Description
Fixes F-7430
Fixes an occasional failure seen in CI.
psa_ecc_verify_cbbuilds the signature by joiningrandswith leading zeros removed. PSA expects r and s to be padded to the curve size, so when either has a leading zero, the sig is rejected (about 1 in 128).Change is to zero extend/append each value to the curve size.
Testing
New unit tests
Checklist