Uh oh!
There was an error while loading. Please reload this page.
crypto: fix misleading positional argument - #57843
Merged
nodejs-github-bot merged 1 commit intoApr 13, 2025
Merged
Conversation
The fourth positional argument of `createCipherBase` is `true` when called from within the `Cipheriv` constructor and `false`when called from within the `Decipheriv` constructor. This value is then passed to the `CipherBase::New()` method, which treats it as follows: args[0]->IsTrue() ? kCipher : kDecipher However, the current name of said positional argument is `decipher` and thus indicates the exact opposite: when the argument is set to true, the instance is *not* a `Decipheriv` object. Therefore, this commit renames the argument to `isEncrypt`, which matches the actual semantics.
nodejs-github-bot
commented
Apr 11, 2025
Collaborator
Review requested:
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@## main #57843 +/- ##
=======================================
Coverage 90.22% 90.23% =======================================
Files 630 630 Lines 185481 185481 Branches 36364 36372 +8 =======================================
+ Hits 167357 167368 +11 + Misses 11004 10994 -10 + Partials 7120 7119 -1
🚀 New features to boost your workflow:
|
targos
approved these changes
Apr 12, 2025
lpinca
approved these changes
Apr 12, 2025
geeksilva97
approved these changes
Apr 12, 2025
jasnell
approved these changes
Apr 12, 2025
nodejs-github-bot
commented
Apr 12, 2025
Collaborator
nodejs-github-bot
commented
Apr 13, 2025
Collaborator
Landed in 29af9ce |
RafaelGSS pushed a commit
that referenced
this pull request
May 1, 2025
The fourth positional argument of `createCipherBase` is `true` when called from within the `Cipheriv` constructor and `false`when called from within the `Decipheriv` constructor. This value is then passed to the `CipherBase::New()` method, which treats it as follows: args[0]->IsTrue() ? kCipher : kDecipher However, the current name of said positional argument is `decipher` and thus indicates the exact opposite: when the argument is set to true, the instance is *not* a `Decipheriv` object. Therefore, this commit renames the argument to `isEncrypt`, which matches the actual semantics. PR-URL: #57843 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
RafaelGSS pushed a commit
that referenced
this pull request
May 2, 2025
The fourth positional argument of `createCipherBase` is `true` when called from within the `Cipheriv` constructor and `false`when called from within the `Decipheriv` constructor. This value is then passed to the `CipherBase::New()` method, which treats it as follows: args[0]->IsTrue() ? kCipher : kDecipher However, the current name of said positional argument is `decipher` and thus indicates the exact opposite: when the argument is set to true, the instance is *not* a `Decipheriv` object. Therefore, this commit renames the argument to `isEncrypt`, which matches the actual semantics. PR-URL: #57843 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
aduh95
commented
May 6, 2025
Contributor
This needs a manual backport for v22.x |
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 freeto 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.
The fourth positional argument of
createCipherBaseistruewhen called from within theCipherivconstructor andfalsewhen called from within theDecipherivconstructor. This value is then passed to theCipherBase::New()method, which treats it as follows:However, the current name of said positional argument is
decipherand thus indicates the exact opposite: when the argument is set to true, the instance is not aDecipherivobject. Therefore, this commit renames the argument toisEncrypt, which matches the actual semantics.