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

fix nkeys seed read \n caused invalid seed #426

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

aohan237
Copy link

if you read nkey files, the origin method will read \n , so it will cause nkey seed load error, invalid nkey seed.

just strip the \n will do the work

this request only add a seed.strip() likes line before nkey.from_seed to pure the seed

@@ -561,6 +563,7 @@ def sig_cb(nonce: str) -> bytes:
# into the pre allocated bytearray.
user_seed = bytearray(nkey_size)
f.readinto(user_seed) # type: ignore[attr-defined]
user_seed = user_seed.strip()
Copy link
Member

Choose a reason for hiding this comment

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

I think this is the fix?

Copy link
Author

Choose a reason for hiding this comment

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

yes, all the seed related with nkeys will all need this strip, otherwise still cause invalid seed

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.

None yet

2 participants