Detect invalid private keys when importing them#1007
Merged
Conversation
MegaLinter status: ✅ SUCCESS
See errors details in artifact MegaLinter reports on CI Job page |
Codecov Report
@@ Coverage Diff @@
## master #1007 +/- ##
==========================================
+ Coverage 88.71% 88.76% +0.05%
==========================================
Files 101 101
Lines 1754 1763 +9
Branches 405 406 +1
==========================================
+ Hits 1556 1565 +9
Misses 198 198
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Contributor
Author
|
Here is how to test this: 1. Reproduce the error on master branch
2. Try the same thing on this branch
|
pro-wh
approved these changes
Sep 21, 2022
7990cc4 to
3d94011
Compare
lukaw3d
reviewed
Sep 22, 2022
| const testMessage = Uint8Array.from([1, 2, 3]) | ||
| const signedTestMessage = nacl.sign(testMessage, secretKey) | ||
| const testDecoded = nacl.sign.open(signedTestMessage, publicKey) | ||
| return `${testDecoded}` === `${testMessage}` |
Contributor
There was a problem hiding this comment.
I don't like the implicit string conversion - explicit .join(',') would be much better. But I would use uint2hex.
csillag
added a commit
that referenced
this pull request
Sep 22, 2022
... when doing UInt8Array to string conversion. This improves upon #1007.
This file contains hidden or 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
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.
Fixes #960.