From 7455597815d79b64aa918f42976bbf53d518d456 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Tue, 4 Dec 2018 05:11:14 +0100 Subject: [PATCH] src: remove finalized_ member from Hash class This commit removes the finalized_ member from the Hash class as it does not seem to be used in any valuable way. Commit c75f87cc4c8 ("crypto: refactor the crypto module") removed the check where it was previously used. PR-URL: https://github.com/nodejs/node/pull/24822 Reviewed-By: Anna Henningsen Reviewed-By: Joyee Cheung Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca --- src/node_crypto.cc | 2 -- src/node_crypto.h | 4 +--- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/node_crypto.cc b/src/node_crypto.cc index 295aaa8e14937d..ed89f5cab11da1 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -3331,7 +3331,6 @@ bool Hash::HashInit(const char* hash_type) { mdctx_.reset(); return false; } - finalized_ = false; return true; } @@ -3385,7 +3384,6 @@ void Hash::HashDigest(const FunctionCallbackInfo& args) { unsigned int md_len; EVP_DigestFinal_ex(hash->mdctx_.get(), md_value, &md_len); - hash->finalized_ = true; Local error; MaybeLocal rc = diff --git a/src/node_crypto.h b/src/node_crypto.h index 6fcf737f6c43c3..ec784fff88f199 100644 --- a/src/node_crypto.h +++ b/src/node_crypto.h @@ -474,14 +474,12 @@ class Hash : public BaseObject { Hash(Environment* env, v8::Local wrap) : BaseObject(env, wrap), - mdctx_(nullptr), - finalized_(false) { + mdctx_(nullptr) { MakeWeak(); } private: EVPMDPointer mdctx_; - bool finalized_; }; class SignBase : public BaseObject {