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

Strkey: check key is not padded #1804

Open
leighmcculloch opened this issue Oct 2, 2019 · 3 comments · May be fixed by #1815

Comments

@leighmcculloch
Copy link
Member

commented Oct 2, 2019

In stellar-core when decoding a strkey we check that the strkey encoded is not padded by checking that the length is divisible by eight. We don't do this check in the Go SDK, so the Go SDK can successfully decode strkeys that are padded with ===s.

The strkey.Decode function should be changed to disallow padding by requiring the length is divisible by 8.

Example of same logic in stellar-core:
https://github.com/stellar/stellar-core/blob/27387f0/src/crypto/StrKey.cpp#L41-L73

This issue is similar to #1796, but unrelated because it applies to all strkeys and that other issue applies only to public and secret keys that are encoded as a strkey.

@leighmcculloch

This comment has been minimized.

Copy link
Member Author

commented Oct 2, 2019

@bartekn

This comment has been minimized.

Copy link
Member

commented Oct 2, 2019

Sounds good! I think we need to define what strkey is in one of SEPs.

@ysz

This comment has been minimized.

Copy link

commented Oct 9, 2019

@leighmcculloch please assign me. #Hacktoberfest

@ysz ysz referenced a pull request that will close this issue Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.