Skip to content
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

test and fix Nkeys.FromPublicKey #897

Merged
merged 2 commits into from
May 29, 2024
Merged

test and fix Nkeys.FromPublicKey #897

merged 2 commits into from
May 29, 2024

Conversation

Zetanova
Copy link
Contributor

The currently Nkeys.FromPublicKey method produces a NKeyPair with an invalid PublicKey of 56 bytes

@scottf
Copy link
Collaborator

scottf commented May 27, 2024

Could you provide code or algorithm to reproduce this?

@Zetanova
Copy link
Contributor Author

Use the included unit test. The utility function Nkeys.FromPublicKey will never produce a valid NKeyPair instance
src/Tests/UnitTests/TestNkeys.cs

@scottf
Copy link
Collaborator

scottf commented May 29, 2024

@Zetanova This looks good. Could you please add to the main comment a discussion of the primary change, i.e., what was wrong with the old code and why you put in the code that you did.

src/NATS.Client/NKeys.cs Show resolved Hide resolved
Copy link
Collaborator

@scottf scottf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@scottf scottf merged commit 711388d into nats-io:main May 29, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants