FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

crypto: adjust minimum length in `generateKey('hmac', ...)` and `generateKeySync('hmac', ...)` by LiviaMedeiros · Pull Request #42944 · nodejs/node · GitHub

/ node Public

crypto: adjust minimum length in generateKey('hmac', ...) and generateKeySync('hmac', ...) - #42944

Merged
nodejs-github-bot merged 1 commit into
nodejs:masterfrom
LiviaMedeiros:adjust-crypto-keygen
May 4, 2022
Merged

crypto: adjust minimum length in generateKey('hmac', ...) and generateKeySync('hmac', ...)#42944
nodejs-github-bot merged 1 commit into
nodejs:masterfrom
LiviaMedeiros:adjust-crypto-keygen

Conversation

LiviaMedeiros commented May 2, 2022
edited
Loading

Copy link
Copy Markdown
Member

Values in the interval [1, 8) are invalid.

Also affects generateKeySync('hmac', ...)

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/crypto

nodejs-github-bot added crypto Issues and PRs related to the crypto subsystem. needs-ci PRs that need a full CI run. labels May 2, 2022

tniessen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM. Not sure about the semver-ity though.

Copy link
Copy Markdown
Member Author

semver-patch I guess? On that interval, this PR replaces abortion with RangeError.

panva left a comment
edited
Loading

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

panva requested a review from jasnell May 2, 2022 17:39
panva added the request-ci Add this label to start a Jenkins CI on a PR. label May 2, 2022

tniessen commented May 2, 2022

Copy link
Copy Markdown
Member

Ah, I didn't know this aborted before. semver-patch is fine then!

github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label May 2, 2022

This comment was marked as outdated.

Copy link
Copy Markdown
Collaborator

tniessen added the author ready PRs that have at least one approval, no outstanding review comments, and a CI started. label May 3, 2022
tniessen added the commit-queue Add this label to land a pull request using GitHub Actions. label May 4, 2022
nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label May 4, 2022
nodejs-github-bot merged commit a5b8730 into nodejs:master May 4, 2022

Copy link
Copy Markdown
Collaborator

Landed in a5b8730

RafaelGSS pushed a commit that referenced this pull request May 10, 2022
Also affects generateKeySync('hmac', ...)

PR-URL: #42944
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
RafaelGSS mentioned this pull request May 10, 2022
juanarbol pushed a commit that referenced this pull request May 31, 2022
Also affects generateKeySync('hmac', ...)

PR-URL: #42944
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
danielleadams pushed a commit that referenced this pull request Jun 27, 2022
Also affects generateKeySync('hmac', ...)

PR-URL: #42944
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
targos pushed a commit that referenced this pull request Jul 12, 2022
Also affects generateKeySync('hmac', ...)

PR-URL: #42944
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
targos pushed a commit that referenced this pull request Jul 31, 2022
Also affects generateKeySync('hmac', ...)

PR-URL: #42944
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
guangwong pushed a commit to noslate-project/node that referenced this pull request Oct 10, 2022
Also affects generateKeySync('hmac', ...)

PR-URL: nodejs/node#42944
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no outstanding review comments, and a CI started. crypto Issues and PRs related to the crypto subsystem. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL