crypto: move _scrypt call out of handleError funct#28318
Closed
danbev wants to merge 5 commits intonodejs:masterfrom
Closed
crypto: move _scrypt call out of handleError funct#28318danbev wants to merge 5 commits intonodejs:masterfrom
danbev wants to merge 5 commits intonodejs:masterfrom
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.
Collaborator
ZYSzys
approved these changes
Jun 20, 2019
benjamingr
approved these changes
Jun 20, 2019
bnoordhuis
requested changes
Jun 20, 2019
Member
bnoordhuis
left a comment
There was a problem hiding this comment.
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.
Contributor
Author
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.
Collaborator
addaleax
approved these changes
Jun 20, 2019
bnoordhuis
approved these changes
Jun 21, 2019
Member
bnoordhuis
left a comment
There was a problem hiding this comment.
LGTM although it drops the D in DRY.
Trott
approved these changes
Jun 21, 2019
Collaborator
tniessen
approved these changes
Jun 21, 2019
Collaborator
jasnell
approved these changes
Jun 23, 2019
danbev
added a commit
that referenced
this pull request
Jun 24, 2019
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 <zyszys98@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com>
danbev
added a commit
that referenced
this pull request
Jun 24, 2019
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 <zyszys98@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com>
danbev
added a commit
that referenced
this pull request
Jun 24, 2019
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 <zyszys98@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com>
danbev
added a commit
that referenced
this pull request
Jun 24, 2019
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 <zyszys98@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com>
targos
pushed a commit
that referenced
this pull request
Jul 2, 2019
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 <zyszys98@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com>
targos
pushed a commit
that referenced
this pull request
Jul 2, 2019
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 <zyszys98@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com>
targos
pushed a commit
that referenced
this pull request
Jul 2, 2019
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 <zyszys98@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com>
targos
pushed a commit
that referenced
this pull request
Jul 2, 2019
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 <zyszys98@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com>
This was referenced Jul 3, 2019
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit moves the
_scryptfunction call out of thehandleErrorfunction, 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
_scryptwas.Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes