mirror of
https://github.com/openssl/openssl.git
synced 2025-01-08 18:23:31 +08:00
Ensure HMAC_size() handles errors correctly
Reviewed-by: Rich Salz <rsalz@openssl.org>
This commit is contained in:
parent
56a26ce360
commit
708e06c55d
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user