From 1fb691aea95741dcc0f1a76e397b68f1690f31a6 Mon Sep 17 00:00:00 2001 From: Steven Cooreman Date: Mon, 8 Mar 2021 12:01:55 +0100 Subject: [PATCH] Remove superfluous check mac size is previously checked to not be less than 4, so it can't be zero anymore at this point. Signed-off-by: Steven Cooreman --- library/psa_crypto.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/library/psa_crypto.c b/library/psa_crypto.c index a77209498..57053efb0 100644 --- a/library/psa_crypto.c +++ b/library/psa_crypto.c @@ -3022,8 +3022,7 @@ static psa_status_t psa_mac_setup( psa_mac_operation_t *operation, if( PSA_ALG_IS_HMAC( alg ) ) { /* Sanity check. This shouldn't fail on a valid configuration. */ - if( operation->mac_size == 0 || - operation->mac_size > sizeof( operation->ctx.hmac.opad ) ) + if( operation->mac_size > sizeof( operation->ctx.hmac.opad ) ) { status = PSA_ERROR_NOT_SUPPORTED; goto exit;