Skip to content

sodiumHex2Bin silently accepts garbage input #128

@timmc

Description

@timmc

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.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions