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.
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
feat(wasmer/crypto): move sig verifier to crypto pkg #2057
feat(wasmer/crypto): move sig verifier to crypto pkg #2057
Changes from 8 commits
db85f05
eda4236
ed89c50
6f41dfc
73e8d87
11b6016
63a3442
969efc2
9146c37
a839018
43ad637
9531a54
7a9560e
9c31504
fd188fc
53ca92b
610e4cd
5c45a1f
5c15e6f
fbe70d8
c164f4d
e1717bc
f009530
b83cc03
9534e7e
634ea82
973ce6b
ddba19f
da14c99
664aa50
625ca02
975b406
75f6080
7a62d06
7da55ab
2fdabf8
ae14785
f223d65
1ee5e82
4012a66
f7b81b1
52bc4c3
698d36e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
We need to split those two conditions. If error is nil and ok is false (when the verification fails), we should wrap our own error defined in this package (or some shared package) and not wrap the
nil
error returned.Alternatively we could modify
Verify
methods to return an error if the verification fails and not the booleanok
, but that might imply a lot of code changes, so not really a solution here.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.
My suggestion would be:
since when
err != nil
, the cause of it will be explicit onerr
, e.g if one of those happen:and in the case where
err == nill && !ok
, the problem was really the verification step, i.e:The same would apply for
ed25518
.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.
Sure, although don't wrap both errors with
crypto.ErrSignatureVerificationFailed
that looks strange. The parent calling function should wrap the error in this case. Instead you can just have?
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.
looking now it really seems strange that way, changed on 1ee5e82 4012a66
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.
same here, we need these two split