-
Notifications
You must be signed in to change notification settings - Fork 164
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
Add public key hash check in Signed Note verification #2214
Add public key hash check in Signed Note verification #2214
Conversation
edc0d86
to
0b79384
Compare
Signed-off-by: Jang <[email protected]>
Update existing tests and ensure they work as expected and add a unit test case to check for public key mismatch. Signed-off-by: Jang <[email protected]>
0b79384
to
97d9e08
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2214 +/- ##
===========================================
- Coverage 66.46% 51.44% -15.02%
===========================================
Files 92 189 +97
Lines 9258 19478 +10220
===========================================
+ Hits 6153 10021 +3868
- Misses 2359 8378 +6019
- Partials 746 1079 +333
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: Jang <[email protected]>
@haydentherapper Thanks! I have addressed your comment. |
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.
Thanks!
Thanks for the review. I will leave this as it is for now since I don't have the permission to merge. Please let me know if there is anything I can do. |
Summary
This PR adds a public key hash check in
SignedNote.Verify
method.The hash stored in
note.Signature
is compared against the verifier's public key hash. If the hash mismatches, the verification fails.Release Note
SignedNote.Sign
is updated to useGetPublicKeyHash
function.GetPublicKeyHash
is added to calculate sha256 hash of the input public key (copied the existing logic inSignedNote.Sign
method)SignedNote.Verify
is updated to compare hash stored innote.Signature
is and the verifier's public key hash.Documentation