From 252283f2aaf139df7912a6dcb242b346268c4787 Mon Sep 17 00:00:00 2001 From: Andrzej Kurek Date: Tue, 27 Sep 2022 07:54:16 -0400 Subject: [PATCH] Fix missing cipher mode dependencies Signed-off-by: Andrzej Kurek --- library/aes.c | 3 ++- tests/suites/test_suite_aes.function | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/library/aes.c b/library/aes.c index 289890dbe..7d035246f 100644 --- a/library/aes.c +++ b/library/aes.c @@ -1690,7 +1690,8 @@ int mbedtls_aes_self_test( int verbose ) unsigned char key[32]; unsigned char buf[64]; const unsigned char *aes_tests; -#if defined(MBEDTLS_CIPHER_MODE_CBC) || defined(MBEDTLS_CIPHER_MODE_CFB) +#if defined(MBEDTLS_CIPHER_MODE_CBC) || defined(MBEDTLS_CIPHER_MODE_CFB) || \ + defined(MBEDTLS_CIPHER_MODE_OFB) unsigned char iv[16]; #endif #if defined(MBEDTLS_CIPHER_MODE_CBC) diff --git a/tests/suites/test_suite_aes.function b/tests/suites/test_suite_aes.function index 10e53c2a4..6a87d4294 100644 --- a/tests/suites/test_suite_aes.function +++ b/tests/suites/test_suite_aes.function @@ -403,10 +403,14 @@ void aes_misc_params( ) defined(MBEDTLS_CIPHER_MODE_XTS) || \ defined(MBEDTLS_CIPHER_MODE_CFB) || \ defined(MBEDTLS_CIPHER_MODE_OFB) - mbedtls_aes_context aes_ctx; const unsigned char in[16] = { 0 }; unsigned char out[16]; #endif +#if defined(MBEDTLS_CIPHER_MODE_CBC) || \ + defined(MBEDTLS_CIPHER_MODE_CFB) || \ + defined(MBEDTLS_CIPHER_MODE_OFB) +mbedtls_aes_context aes_ctx; +#endif #if defined(MBEDTLS_CIPHER_MODE_XTS) mbedtls_aes_xts_context xts_ctx; #endif