Properly specify the encoding when verifying ECDSA signatures #405
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.
When verifying an ECDSA signature, properly specify how to convert the byte sequence to a pair of integers, which RFC 6090 requires, by referring to the Octet-String-to-Integer Conversion steps in RFC 6090.
If the signature is of an incorrect length, return false, as the web platform tests require and all implementations seem to do.
Similarly, when signing, refer to the Integer-to-Octet-String Conversion steps in RFC 6090 instead of specifying our own conversion from a byte sequence to an integer.
Also, refer to the proper sections for signing and verifying in RFC 6090. The subsections 5.4.2 and 5.4.3 refer to "KT-I signatures", which are equivalent to ECDSA signatures, while section 5.3 refers to "KT-IV signatures", which are encoded differently.
Finally, harmonize the parameter names with those specified in RFC 6090.
Fixes #404.
Preview | Diff