Commit 708e06c5 authored by Matt Caswell's avatar Matt Caswell
Browse files

Ensure HMAC_size() handles errors correctly



Reviewed-by: default avatarRich Salz <rsalz@openssl.org>
parent 56a26ce3
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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)