Skip to content

Commit

Permalink
src: remove finalized_ member from Hash class
Browse files Browse the repository at this point in the history
This commit removes the finalized_ member from the Hash class as it does
not seem to be used in any valuable way. Commit c75f87c ("crypto:
refactor the crypto module") removed the check where it was previously
used.

PR-URL: #24822
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
danbev authored and MylesBorins committed Dec 7, 2018
1 parent 90d481e commit 9b000e5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
2 changes: 0 additions & 2 deletions src/node_crypto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3431,7 +3431,6 @@ bool Hash::HashInit(const char* hash_type) {
mdctx_.reset();
return false;
}
finalized_ = false;
return true;
}

Expand Down Expand Up @@ -3485,7 +3484,6 @@ void Hash::HashDigest(const FunctionCallbackInfo<Value>& args) {
unsigned int md_len;

EVP_DigestFinal_ex(hash->mdctx_.get(), md_value, &md_len);
hash->finalized_ = true;

Local<Value> error;
MaybeLocal<Value> rc =
Expand Down
4 changes: 1 addition & 3 deletions src/node_crypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -476,14 +476,12 @@ class Hash : public BaseObject {

Hash(Environment* env, v8::Local<v8::Object> wrap)
: BaseObject(env, wrap),
mdctx_(nullptr),
finalized_(false) {
mdctx_(nullptr) {
MakeWeak();
}

private:
EVPMDPointer mdctx_;
bool finalized_;
};

class SignBase : public BaseObject {
Expand Down

0 comments on commit 9b000e5

Please sign in to comment.