From aa5fa1c740cef6ec63eb78665d29530ff916f2a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?= Date: Sat, 5 Oct 2019 23:00:38 +0200 Subject: [PATCH] crypto: remove guard against fixed OpenSSL bug This guard used to prevent segfaults caused by a bug in OpenSSL, but this was fixed in OpenSSL 1.1.1d. Refs: https://github.com/openssl/openssl/pull/9433 Refs: https://github.com/openssl/openssl/issues/9431 --- src/node_crypto.cc | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/node_crypto.cc b/src/node_crypto.cc index 3405fbb5b45aa4..0cc39b63d29891 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -4806,14 +4806,6 @@ void Hash::HashDigest(const FunctionCallbackInfo& args) { encoding = ParseEncoding(env->isolate(), args[0], BUFFER); } - // TODO(tniessen): SHA3_squeeze does not work for zero-length outputs on all - // platforms and will cause a segmentation fault if called. This workaround - // causes hash.digest() to correctly return an empty buffer / string. - // See https://github.com/openssl/openssl/issues/9431. - if (!hash->has_md_ && hash->md_len_ == 0) { - hash->has_md_ = true; - } - if (!hash->has_md_) { // Some hash algorithms such as SHA3 do not support calling // EVP_DigestFinal_ex more than once, however, Hash._flush