-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
crypto: adjust minimum length in generateKey('hmac', ...)
and generateKeySync('hmac', ...)
#42944
crypto: adjust minimum length in generateKey('hmac', ...)
and generateKeySync('hmac', ...)
#42944
Conversation
Also affects generateKeySync('hmac', ...)
Review requested:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Not sure about the semver-ity though.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this surfaced together with Web Crypto API. I also believe the intention was to follow the way Web Crypto API works in Node.js, that is "multiples of 8", in which case, length should've been in bytes, not bits...
Since any other bit length that isn't a multiple of 8 is rounded down, this patched behaviour is IMHO correct and falls within a fix semver-ity ;)
cc @jasnell
Ah, I didn't know this |
This comment was marked as outdated.
This comment was marked as outdated.
Landed in a5b8730 |
Also affects generateKeySync('hmac', ...) PR-URL: #42944 Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Filip Skokan <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
Also affects generateKeySync('hmac', ...) PR-URL: #42944 Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Filip Skokan <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
Also affects generateKeySync('hmac', ...) PR-URL: #42944 Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Filip Skokan <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
Also affects generateKeySync('hmac', ...) PR-URL: #42944 Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Filip Skokan <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
Also affects generateKeySync('hmac', ...) PR-URL: #42944 Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Filip Skokan <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
Also affects generateKeySync('hmac', ...) PR-URL: nodejs/node#42944 Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Filip Skokan <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
Values in the interval
[1, 8)
are invalid.