From 8f9ee7a33f4e8a52642335673f2cdc57ecdd38cc Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Wed, 21 Jun 2017 15:55:20 +0100 Subject: [PATCH] Remove OPENSSL_assert() from crypto/hmac Reviewed-by: Andy Polyakov (Merged from https://github.com/openssl/openssl/pull/3740) --- crypto/hmac/hmac.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crypto/hmac/hmac.c b/crypto/hmac/hmac.c index 3952dd50ad..156725ea4c 100644 --- a/crypto/hmac/hmac.c +++ b/crypto/hmac/hmac.c @@ -37,7 +37,8 @@ int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len, if (key != NULL) { reset = 1; j = EVP_MD_block_size(md); - OPENSSL_assert(j <= (int)sizeof(ctx->key)); + if (!ossl_assert(j <= (int)sizeof(ctx->key))) + goto err; if (j < len) { if (!EVP_DigestInit_ex(ctx->md_ctx, md, impl)) goto err; -- 2.34.1