Skip to content

Commit

Permalink
crypto: remove leftover initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
MylesBorins committed Feb 7, 2018
1 parent 37142c6 commit dfaf1ec
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/node_crypto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3922,7 +3922,6 @@ void Hmac::New(const FunctionCallbackInfo<Value>& args) {
void Hmac::HmacInit(const char* hash_type, const char* key, int key_len) {
HandleScope scope(env()->isolate());

CHECK_EQ(initialised_, false);
const EVP_MD* md = EVP_get_digestbyname(hash_type);
if (md == nullptr) {
return env()->ThrowError("Unknown message digest");
Expand Down Expand Up @@ -4070,7 +4069,6 @@ void Hash::New(const FunctionCallbackInfo<Value>& args) {


bool Hash::HashInit(const char* hash_type) {
CHECK_EQ(initialised_, false);
const EVP_MD* md = EVP_get_digestbyname(hash_type);
if (md == nullptr)
return false;
Expand Down Expand Up @@ -4102,9 +4100,6 @@ void Hash::HashUpdate(const FunctionCallbackInfo<Value>& args) {

THROW_AND_RETURN_IF_NOT_STRING_OR_BUFFER(args[0], "Data");

if (!hash->initialised_) {
return env->ThrowError("Not initialized");
}
if (hash->finalized_) {
return env->ThrowError("Digest already called");
}
Expand Down Expand Up @@ -4134,9 +4129,6 @@ void Hash::HashDigest(const FunctionCallbackInfo<Value>& args) {
Hash* hash;
ASSIGN_OR_RETURN_UNWRAP(&hash, args.Holder());

if (!hash->initialised_) {
return env->ThrowError("Not initialized");
}
if (hash->finalized_) {
return env->ThrowError("Digest already called");
}
Expand Down

0 comments on commit dfaf1ec

Please sign in to comment.