Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 08e2d8a

Browse filesBrowse files
tniessenbengl
authored andcommitted
src: check return value of HMAC_Final
PR-URL: #42303 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
1 parent eb0e1a1 commit 08e2d8a
Copy full SHA for 08e2d8a

File tree

Expand file treeCollapse file tree

1 file changed

+4
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-1
lines changed
Open diff view settings
Collapse file

‎src/crypto/crypto_hmac.cc‎

Copy file name to clipboardExpand all lines: src/crypto/crypto_hmac.cc
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,11 @@ void Hmac::HmacDigest(const FunctionCallbackInfo<Value>& args) {
124124
unsigned int md_len = 0;
125125

126126
if (hmac->ctx_) {
127-
HMAC_Final(hmac->ctx_.get(), md_value, &md_len);
127+
bool ok = HMAC_Final(hmac->ctx_.get(), md_value, &md_len);
128128
hmac->ctx_.reset();
129+
if (!ok) {
130+
return ThrowCryptoError(env, ERR_get_error(), "Failed to finalize HMAC");
131+
}
129132
}
130133

131134
Local<Value> error;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.