-
Notifications
You must be signed in to change notification settings - Fork 30.2k
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: move _scrypt call out of handleError funct #28318
Conversation
This commit moves the _scrypt function call out of the handleError function, which now only takes in an error object as its parameter. The motivation for this is to hopefully improve readability as it was not clear to me the first time I stepped through the code where the actual call to _scrypt was.
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.
If you're going to make this change, you should also make it to pbkdf2.js, random.js and (possibly) keygen.js, otherwise you're introducing style inconsistencies between the files in lib/internal/crypto.
Ah I see, let me take a look and update them too. Thanks |
This commit moves the _randomBytes function call out of the handleError function, which now it takes in an error and a buf object as its parameters.
This commit moves the _pbkdf2 function call out of the handleError function, which now only takes in an error and a digest object as its parameters.
This commit moves the _impl function call out of the handleError function, which now only takes in an object as its parameter.
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 although it drops the D in DRY.
This commit moves the _scrypt function call out of the handleError function, which now only takes in an error object as its parameter. The motivation for this is to hopefully improve readability as it was not clear to me the first time I stepped through the code where the actual call to _scrypt was. PR-URL: #28318 Reviewed-By: Yongsheng Zhang <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: James M Snell <[email protected]>
This commit moves the _randomBytes function call out of the handleError function, which now it takes in an error and a buf object as its parameters. PR-URL: #28318 Reviewed-By: Yongsheng Zhang <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: James M Snell <[email protected]>
This commit moves the _pbkdf2 function call out of the handleError function, which now only takes in an error and a digest object as its parameters. PR-URL: #28318 Reviewed-By: Yongsheng Zhang <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: James M Snell <[email protected]>
This commit moves the _impl function call out of the handleError function, which now only takes in an object as its parameter. PR-URL: #28318 Reviewed-By: Yongsheng Zhang <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: James M Snell <[email protected]>
This commit moves the _scrypt function call out of the handleError function, which now only takes in an error object as its parameter. The motivation for this is to hopefully improve readability as it was not clear to me the first time I stepped through the code where the actual call to _scrypt was. PR-URL: #28318 Reviewed-By: Yongsheng Zhang <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: James M Snell <[email protected]>
This commit moves the _randomBytes function call out of the handleError function, which now it takes in an error and a buf object as its parameters. PR-URL: #28318 Reviewed-By: Yongsheng Zhang <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: James M Snell <[email protected]>
This commit moves the _pbkdf2 function call out of the handleError function, which now only takes in an error and a digest object as its parameters. PR-URL: #28318 Reviewed-By: Yongsheng Zhang <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: James M Snell <[email protected]>
This commit moves the _impl function call out of the handleError function, which now only takes in an object as its parameter. PR-URL: #28318 Reviewed-By: Yongsheng Zhang <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: James M Snell <[email protected]>
This commit moves the
_scrypt
function call out of thehandleError
function, which now only takes in an error object as its parameter.
The motivation for this is to hopefully improve readability as it was
not clear to me the first time I stepped through the code where the
actual call to
_scrypt
was.Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes