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

ValueError Sometimes Raised When Authenticating #14

Open
jusexton opened this issue Jul 13, 2020 · 1 comment
Open

ValueError Sometimes Raised When Authenticating #14

jusexton opened this issue Jul 13, 2020 · 1 comment

Comments

@jusexton
Copy link

jusexton commented Jul 13, 2020

A ValueError is sometimes being raised when attempting to authenticate credentials. The error occurs when a salt value contains a leading dash. For example: -16e462a84f2df159eee0c14642974ee7. This seems to only happen when a given username does not exist within the userpool? But not always.

The value error contains this message: non-hexadecimal number found in fromhex() arg at position 0

I have tracked it down to this snippet (line 174 in aws_srp.py):

x_value = hex_to_long(hex_hash(pad_hex(salt) + username_password_hash))

in the hex_hash function:

def hex_hash(hex_string):
    return hash_sha256(bytearray.fromhex(hex_string))

I would submit a fix but I am not sure how the application is expected to handle these kinds of scenarios.

@jusexton jusexton changed the title Trouble Decoding Salt With Leading Dash('-') Value ValueError Sometimes Raised When Authenticating Jul 14, 2020
@jusexton
Copy link
Author

Looks like this project is having similar issues: aws/aws-sdk-net-extensions-cognito#48

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