From cbf0e5a1f4c9d7c0fa6882561faa74ccce5f4932 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 4e1a3f9405f319..222f4089d8c304 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -3458,7 +3458,6 @@ bool Hash::HashInit(const char* hash_type) { mdctx_.reset(); return false; } - finalized_ = false; return true; } @@ -3512,7 +3511,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 5f98af754ea727..0ee45cf9ea2c02 100644 --- a/src/node_crypto.h +++ b/src/node_crypto.h @@ -476,14 +476,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 {