From b2f3e6ca351c5e85b07d246ddb4c6d704145d421 Mon Sep 17 00:00:00 2001 From: Steven Cooreman Date: Fri, 15 Jan 2021 16:49:55 +0100 Subject: [PATCH] Restrict test skipping to AES-192 specifically Signed-off-by: Steven Cooreman --- library/cmac.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/library/cmac.c b/library/cmac.c index b8e7ca3c8..cdb5ed0b1 100644 --- a/library/cmac.c +++ b/library/cmac.c @@ -785,8 +785,9 @@ static int cmac_test_subkeys( int verbose, * the underlying primitive itself is implemented alternatively, * certain features (e.g. AES-192) may be unavailable. This should * not cause the selftest function to fail. */ - if( ret == MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED || - ret == MBEDTLS_ERR_CIPHER_FEATURE_UNAVAILABLE ) { + if( ( ret == MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED + || ret == MBEDTLS_ERR_CIPHER_FEATURE_UNAVAILABLE ) + && cipher_type == MBEDTLS_CIPHER_AES_192_ECB ) { if( verbose != 0 ) mbedtls_printf( "skipped\n" ); goto next_test; @@ -868,8 +869,9 @@ static int cmac_test_wth_cipher( int verbose, * the underlying primitive itself is implemented alternatively, * certain features (e.g. AES-192) may be unavailable. This should * not cause the selftest function to fail. */ - if( ret == MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED || - ret == MBEDTLS_ERR_CIPHER_FEATURE_UNAVAILABLE ) { + if( ( ret == MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED + || ret == MBEDTLS_ERR_CIPHER_FEATURE_UNAVAILABLE ) + && cipher_type == MBEDTLS_CIPHER_AES_192_ECB ) { if( verbose != 0 ) mbedtls_printf( "skipped\n" ); continue;