From 0b7bf876e4cdee4a94dc3414cdc96cece6858e7a Mon Sep 17 00:00:00 2001 From: Dave Rodgman Date: Mon, 14 Aug 2023 14:25:29 +0100 Subject: [PATCH 1/4] Fix compile fail for empty enum in cipher_wrap Signed-off-by: Dave Rodgman --- library/cipher_wrap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/library/cipher_wrap.c b/library/cipher_wrap.c index da4e739c87..890be3c767 100644 --- a/library/cipher_wrap.c +++ b/library/cipher_wrap.c @@ -120,8 +120,10 @@ enum mbedtls_cipher_base_index { MBEDTLS_CIPHER_BASE_INDEX_NULL_BASE, #endif #if defined(MBEDTLS_CIPHER_MODE_XTS) && defined(MBEDTLS_AES_C) - MBEDTLS_CIPHER_BASE_INDEX_XTS_AES + MBEDTLS_CIPHER_BASE_INDEX_XTS_AES, #endif + /* Prevent compile failure due to empty enum */ + MBEDTLS_PREVENT_EMPTY_ENUM }; #if defined(MBEDTLS_GCM_C) From b8f23b9cfbcca01e6a893b31e192b91c4ee43265 Mon Sep 17 00:00:00 2001 From: Dave Rodgman Date: Mon, 14 Aug 2023 14:28:23 +0100 Subject: [PATCH 2/4] Changelog Signed-off-by: Dave Rodgman --- ChangeLog.d/fix-empty-enum.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 ChangeLog.d/fix-empty-enum.txt diff --git a/ChangeLog.d/fix-empty-enum.txt b/ChangeLog.d/fix-empty-enum.txt new file mode 100644 index 0000000000..f0aba1987c --- /dev/null +++ b/ChangeLog.d/fix-empty-enum.txt @@ -0,0 +1,3 @@ +Bugfix + * Fix compile failure due to empty enum in cipher_wrap.o, when building + with a very minimal configuration. Fixes #7625. From f97eb58e514c2270f97c036beafab5a489b09c7a Mon Sep 17 00:00:00 2001 From: Dave Rodgman Date: Mon, 14 Aug 2023 15:19:23 +0100 Subject: [PATCH 3/4] Fix Changelog Signed-off-by: Dave Rodgman --- ChangeLog.d/fix-empty-enum.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog.d/fix-empty-enum.txt b/ChangeLog.d/fix-empty-enum.txt index f0aba1987c..458d58f3bb 100644 --- a/ChangeLog.d/fix-empty-enum.txt +++ b/ChangeLog.d/fix-empty-enum.txt @@ -1,3 +1,3 @@ Bugfix - * Fix compile failure due to empty enum in cipher_wrap.o, when building + * Fix compile failure due to empty enum in cipher_wrap.c, when building with a very minimal configuration. Fixes #7625. From e3330f86d28af5e574c57cc6ea5c837fa9f9d5fb Mon Sep 17 00:00:00 2001 From: Dave Rodgman Date: Mon, 14 Aug 2023 15:26:28 +0100 Subject: [PATCH 4/4] Make naming more consistent Signed-off-by: Dave Rodgman --- library/cipher_wrap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/cipher_wrap.c b/library/cipher_wrap.c index 890be3c767..6ab2f5f132 100644 --- a/library/cipher_wrap.c +++ b/library/cipher_wrap.c @@ -123,7 +123,7 @@ enum mbedtls_cipher_base_index { MBEDTLS_CIPHER_BASE_INDEX_XTS_AES, #endif /* Prevent compile failure due to empty enum */ - MBEDTLS_PREVENT_EMPTY_ENUM + MBEDTLS_CIPHER_BASE_PREVENT_EMPTY_ENUM }; #if defined(MBEDTLS_GCM_C)