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

sodiumHex2Bin silently accepts garbage input #128

Open
timmc opened this issue Aug 16, 2023 · 0 comments
Open

sodiumHex2Bin silently accepts garbage input #128

timmc opened this issue Aug 16, 2023 · 0 comments

Comments

@timmc
Copy link
Contributor

timmc commented Aug 16, 2023

The implementation hexToBytes accepts non-hex characters and does math on their values as if they are hex chars. For example,ABCD__ and ABCDEF turn into the same bytes. (Character.digit uses a return value of -1 as an error code.)

(EDIT: I had previously thought it didn't fail for an odd number of characters, but it actually does. However, an explicit check would be safer.)

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

No branches or pull requests

1 participant