-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
Enhance Cipheriv, Decipheriv coverage #17458
Conversation
- Call constructor without new keyword - Call constructor with cipher is not string - Call constructor with cipher is string and key is not string - Call constructor with cipher is strong, key is string and iv is not string
- Call constructor without new keyword - Call constructor with cipher is not string - Call constructor with cipher is string and key is not string - Call constructor with cipher is strong, key is string and iv is not string
Just a general note, is there any advantage to not using the |
@maclover7 Thank you for your review. |
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.
One quick nit then LGTM
const key = '123456789012345678901234'; | ||
const iv = '12345678'; | ||
|
||
const instance = Cipheriv('des-ede3-cbc', key, iv); |
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.
createCipheriv
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.
This line cannot use createCipheriv
because createCipheriv
calls constructor with new keyword always.
I want to test call constructor without new keyword.
Landed in 6707903 |
PR-URL: #17458 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
This relies on changes in #16527 Setting as don't land for <=v9.x |
I added these tests:
Cipheriv
Decipheriv
Current coverage is here: https://coverage.nodejs.org/coverage-06e1b0386196f8f8/root/internal/crypto/cipher.js.html
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
test