From dba0644818dde3167e0960336add3c0bd3cba867 Mon Sep 17 00:00:00 2001 From: Steven Cooreman Date: Thu, 6 May 2021 18:08:30 +0200 Subject: [PATCH] Remove superfluous check As psa_mac_sign_finish / psa_mac_verify_finish already checks that the operation structure is valid (id is non-zero), the driver itself doesn't have to check for that anymore. If the operation has a driver ID assigned, it means that driver has returned success from its setup function, so the algorithm value will be set correctly. Signed-off-by: Steven Cooreman --- library/psa_crypto_mac.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/library/psa_crypto_mac.c b/library/psa_crypto_mac.c index dc07d455e..3d7f70bac 100644 --- a/library/psa_crypto_mac.c +++ b/library/psa_crypto_mac.c @@ -452,8 +452,6 @@ static psa_status_t mac_finish_internal( mbedtls_psa_mac_operation_t *operation, uint8_t *mac, size_t mac_size ) { - if( operation->alg == 0 ) - return( PSA_ERROR_BAD_STATE ); if( mac_size < operation->mac_size ) return( PSA_ERROR_BUFFER_TOO_SMALL );