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

Fixing setHMACKey arguments to pass a UINT8ARRAY instead of a string. #2

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

Conversation

diegoocampoh
Copy link

When doing base32.decode(this.key).toString(), the result is an array of unsigned ints, but we are passing it to jssha as BYTES. This causes the values in the negative range to be read as positive, effectively changing the secret.

Since base32.decode(this.key) produces a UINT8ARRAY, the proper parameter to jssha is setHMACKey(base32.decode(this.key), 'UINT8ARRAY')

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

1 participant