mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
src: turn key length exception into CHECK
This exception can logically never happen because of the key stretching that takes place first. Failure must therefore be a bug in Node.js and not in the executing script. PR-URL: https://github.com/nodejs/node/pull/15183 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
1 parent
78a71aa123
commit
f81812b1ff
1 file changed
+1
-4
+1
-4
@@ -3352,10 +3352,7 @@ void CipherBase::Init(const char* cipher_type,
|
||||
if (mode == EVP_CIPH_WRAP_MODE)
|
||||
EVP_CIPHER_CTX_set_flags(&ctx_, EVP_CIPHER_CTX_FLAG_WRAP_ALLOW);
|
||||
|
||||
if (!EVP_CIPHER_CTX_set_key_length(&ctx_, key_len)) {
|
||||
EVP_CIPHER_CTX_cleanup(&ctx_);
|
||||
return env()->ThrowError("Invalid key length");
|
||||
}
|
||||
CHECK_EQ(1, EVP_CIPHER_CTX_set_key_length(&ctx_, key_len));
|
||||
|
||||
EVP_CipherInit_ex(&ctx_,
|
||||
nullptr,
|
||||
|
||||
Reference in new issue
Block a user