We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7612fc3 commit a718ef9Copy full SHA for a718ef9
src/crypto/crypto_hmac.cc
@@ -124,8 +124,11 @@ void Hmac::HmacDigest(const FunctionCallbackInfo<Value>& args) {
124
unsigned int md_len = 0;
125
126
if (hmac->ctx_) {
127
- HMAC_Final(hmac->ctx_.get(), md_value, &md_len);
+ bool ok = HMAC_Final(hmac->ctx_.get(), md_value, &md_len);
128
hmac->ctx_.reset();
129
+ if (!ok) {
130
+ return ThrowCryptoError(env, ERR_get_error(), "Failed to finalize HMAC");
131
+ }
132
}
133
134
Local<Value> error;
0 commit comments