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

crypto: allow undefined for saltLength and padding #26921

Conversation

tniessen
Copy link
Member

Using options.hasOwnProperty is not how we usually validate options. Passing { saltLength } where saltLength === undefined should be equivalent to not passing a saltLength option in my opinion. Feel free to disagree!

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added the crypto Issues and PRs related to the crypto subsystem. label Mar 26, 2019
Copy link
Contributor

@sam-github sam-github left a comment

Choose a reason for hiding this comment

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

I agree.

@nodejs-github-bot
Copy link
Collaborator

@BridgeAR BridgeAR added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Mar 26, 2019
Copy link
Member

@bnoordhuis bnoordhuis left a comment

Choose a reason for hiding this comment

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

I agree. For reference, the hasOwnProperty() check was introduced in #11705.

@panva
Copy link
Member

panva commented Mar 27, 2019

I agree. The only reason i can come up with is that providing undefined as the property's value is indicative of users thinking they pass the constant value while in fact they're not, so before this PR their error would be caught right there, now it won't and the defaults will be applied.

@tniessen

This comment has been minimized.

@tniessen
Copy link
Member Author

Thanks for reviewing, landed in c35acc0.

@tniessen tniessen closed this Mar 28, 2019
tniessen added a commit that referenced this pull request Mar 28, 2019
PR-URL: #26921
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
migounette pushed a commit to migounette/node-js that referenced this pull request Mar 28, 2019
PR-URL: nodejs#26921
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
targos pushed a commit that referenced this pull request Mar 28, 2019
PR-URL: #26921
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
BethGriggs pushed a commit that referenced this pull request Apr 5, 2019
PR-URL: #26921
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
BethGriggs pushed a commit that referenced this pull request Apr 8, 2019
PR-URL: #26921
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Signed-off-by: Beth Griggs <[email protected]>
@BethGriggs BethGriggs mentioned this pull request Apr 9, 2019
@tniessen tniessen removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jan 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crypto Issues and PRs related to the crypto subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants