-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
{Hash, Hmac}.digest and sign hard crash when supplied 'ucs2' encoding #9817
Labels
crypto
Issues and PRs related to the crypto subsystem.
Comments
addaleax
added a commit
to addaleax/node
that referenced
this issue
Apr 29, 2017
Throw `Error`s instead of hard crashing when the `.digest()` output encoding is UTF-16. Fixes: nodejs#9817
3 tasks
anchnk
pushed a commit
to anchnk/node
that referenced
this issue
May 6, 2017
Throw `Error`s instead of hard crashing when the `.digest()` output encoding is UTF-16. Fixes: nodejs#9817 PR-URL: nodejs#12752 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
gibfahn
pushed a commit
that referenced
this issue
Jun 18, 2017
Throw `Error`s instead of hard crashing when the `.digest()` output encoding is UTF-16. Fixes: #9817 PR-URL: #12752 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
gibfahn
pushed a commit
that referenced
this issue
Jun 20, 2017
Throw `Error`s instead of hard crashing when the `.digest()` output encoding is UTF-16. Fixes: #9817 PR-URL: #12752 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
MylesBorins
pushed a commit
that referenced
this issue
Jul 11, 2017
Throw `Error`s instead of hard crashing when the `.digest()` output encoding is UTF-16. Fixes: #9817 PR-URL: #12752 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Several hash functions hard crash when supplied 'ucs2' encodings.
Snippet for Hash:
Snippet for Hmac:
This is because for both the binding layer functions end up calling
StringBytes::Encode
withUCS2
, which has a hard check:The
Sign::SignFinal
binding function does this too, but the js wrapper alwayscalls it with the encoding set to
null
. So you'd have to call handle directlyto crash:
I'm not sure if this was intentional for
sign.sign()
(to be always called withnull encoding), but I suspect not.
+@mlfbrown for joint work.
The text was updated successfully, but these errors were encountered: