Padding of the R and S components in case they are smaller than 31 bytes for SECP256r1 #52
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.
Note from @NicolasMassart (Consensys Customer Support):
This PR if from one of the Consensys customers directly. I removed the internal reference to our ticketing system as it's not useful to HL community as they don't have access. The PR is well referenced in the ticket on our side.
Description of the issue
Sometimes the signature components (in that case it was R) are 30-bytes long and both the keys and the signatures are still valid.
The values added in the unit test are taken from one of the actual errors shown in the error logs:
There is another test created in this fork on an upper level for Besu checking precisely the same as this test.
Fix
Add proper padding to signatures
Signed-off by: [email protected]