aes: validate keys using crc before encryption/decryption
CRC is calculated when the key is set. This commit also adds new tests
for ecb encryption and decryption, simulating a fault injection after the key is set.
Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
diff --git a/programs/ssl/query_config.c b/programs/ssl/query_config.c
index e83671c..af77ed5 100644
--- a/programs/ssl/query_config.c
+++ b/programs/ssl/query_config.c
@@ -1874,6 +1874,14 @@
}
#endif /* MBEDTLS_CRC_C */
+#if defined(MBEDTLS_VALIDATE_AES_KEYS_INTEGRITY)
+ if( strcmp( "MBEDTLS_VALIDATE_AES_KEYS_INTEGRITY", config ) == 0 )
+ {
+ MACRO_EXPANSION_TO_STR( MBEDTLS_VALIDATE_AES_KEYS_INTEGRITY );
+ return( 0 );
+ }
+#endif /* MBEDTLS_VALIDATE_AES_KEYS_INTEGRITY */
+
#if defined(MBEDTLS_GCM_C)
if( strcmp( "MBEDTLS_GCM_C", config ) == 0 )
{