-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pkg/crypto: cover account/prefixed data sig verification and fix case sensitivity #139
Conversation
This file contains 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
jchappelow
force-pushed
the
sig-verif
branch
3 times, most recently
from
August 5, 2023 01:58
c21cfff
to
13da5f5
Compare
brennanjl
approved these changes
Aug 10, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I force pushed a rebase on main, but it did not change anything.
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
brennanjl
pushed a commit
that referenced
this pull request
Feb 26, 2024
… sensitivity (#139) * test for non-canonical eth address encodings * use SigToPub in regular sig verification --------- Co-authored-by: Jonathan Chappelow <jonathan.chappelow@gmail.com>
brennanjl
pushed a commit
that referenced
this pull request
Feb 26, 2024
… sensitivity (#139) * test for non-canonical eth address encodings * use SigToPub in regular sig verification --------- Co-authored-by: Jonathan Chappelow <jonathan.chappelow@gmail.com>
jchappelow
added a commit
that referenced
this pull request
Feb 26, 2024
… sensitivity (#139) * test for non-canonical eth address encodings * use SigToPub in regular sig verification --------- Co-authored-by: Jonathan Chappelow <jonathan.chappelow@gmail.com>
brennanjl
pushed a commit
that referenced
this pull request
Feb 26, 2024
… sensitivity (#139) * test for non-canonical eth address encodings * use SigToPub in regular sig verification --------- Co-authored-by: Jonathan Chappelow <jonathan.chappelow@gmail.com>
brennanjl
pushed a commit
that referenced
this pull request
Feb 26, 2024
… sensitivity (#139) * test for non-canonical eth address encodings * use SigToPub in regular sig verification --------- Co-authored-by: Jonathan Chappelow <jonathan.chappelow@gmail.com>
brennanjl
pushed a commit
that referenced
this pull request
Feb 26, 2024
… sensitivity (#139) * test for non-canonical eth address encodings * use SigToPub in regular sig verification --------- Co-authored-by: Jonathan Chappelow <jonathan.chappelow@gmail.com>
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.
Came across a minor inconsistency while initially reviewing the code. This is not very consequential, but the change is relatively trivial, adds test coverage, and simplifies the two signature verification methods. The only observable change is that signatures from clients like a frontend producing signatures from metamask will verify successfully if there are inconsequential string case deviations in the address. This matches the verification from clients like
pkg/client
/kwil-cli
.The first commit adds test coverage for the verification code in
checkSignatureAccountSECP256k1Uncompressed
, which is the verification used for signatures made by clients such as Kuneiform with MetaMask as the signer (crypto.ACCOUNT_SECP256K1_UNCOMPRESSED
).The second commit introduces a minor refactor to reuse common code between the two signature verification helpers, and it fixes a bug that causes the last test introduced in the first commit to fail if there is any string case or prefix deviation from the canonical (EIP 55) formatting. The verification for
PK_SECP256K1_UNCOMPRESSED
-type signatures was already fine.