mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
src: don't check failure with ERR_peek_error()
It's possible there is already an existing error on OpenSSL's error stack that is unrelated to the EVP_DigestInit_ex() operation we just executed. Fixes: https://github.com/nodejs/node/issues/4221 PR-URL: https://github.com/nodejs/node/pull/4731 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Fedor Indutny <fedor@indutny.com>
This commit is contained in:
1 parent
83d2b7707e
commit
761cf2bf6a
1 file changed
+1
-2
+1
-2
@@ -3611,8 +3611,7 @@ bool Hash::HashInit(const char* hash_type) {
|
||||
if (md_ == nullptr)
|
||||
return false;
|
||||
EVP_MD_CTX_init(&mdctx_);
|
||||
EVP_DigestInit_ex(&mdctx_, md_, nullptr);
|
||||
if (0 != ERR_peek_error()) {
|
||||
if (EVP_DigestInit_ex(&mdctx_, md_, nullptr) <= 0) {
|
||||
return false;
|
||||
}
|
||||
initialised_ = true;
|
||||
|
||||
Reference in new issue
Block a user