提交 708e06c5 编写于 作者: M Matt Caswell

Ensure HMAC_size() handles errors correctly

Reviewed-by: NRich Salz <rsalz@openssl.org>
上级 56a26ce3
......@@ -118,7 +118,10 @@ int HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len)
size_t HMAC_size(const HMAC_CTX *ctx)
{
return EVP_MD_size((ctx)->md);
int size = EVP_MD_size((ctx)->md);
if (size < 0)
return 0;
return size;
}
HMAC_CTX *HMAC_CTX_new(void)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册