From c453e2e7e835415608733fc6873c7419defc5b38 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Wed, 14 Jun 2023 17:54:38 +0200 Subject: [PATCH] Officially deprecate MBEDTLS_CIPHER_BLKSIZE_MAX Signed-off-by: Gilles Peskine --- include/mbedtls/cmac.h | 2 ++ tests/suites/test_suite_cmac.function | 2 ++ 2 files changed, 4 insertions(+) diff --git a/include/mbedtls/cmac.h b/include/mbedtls/cmac.h index 672aeba6e..b2aca5d04 100644 --- a/include/mbedtls/cmac.h +++ b/include/mbedtls/cmac.h @@ -46,6 +46,7 @@ extern "C" { #define MBEDTLS_CMAC_MAX_BLOCK_SIZE 8 /**< The longest block used by CMAC is that of 3DES. */ #endif +#if !defined(MBEDTLS_DEPRECATED_REMOVED) /** The longest block supported by the cipher module. * * \deprecated @@ -60,6 +61,7 @@ extern "C" { * is sufficient for any cipher, but the name is defined in cmac.h for * backward compatibility. */ #define MBEDTLS_CIPHER_BLKSIZE_MAX MBEDTLS_MAX_BLOCK_LENGTH +#endif /* MBEDTLS_DEPRECATED_REMOVED */ #if !defined(MBEDTLS_CMAC_ALT) diff --git a/tests/suites/test_suite_cmac.function b/tests/suites/test_suite_cmac.function index 1b6fed022..2d7bcd1ab 100644 --- a/tests/suites/test_suite_cmac.function +++ b/tests/suites/test_suite_cmac.function @@ -111,8 +111,10 @@ void mbedtls_cmac_setkey(int cipher_type, int key_size, int result) TEST_ASSERT((cipher_info = mbedtls_cipher_info_from_type(cipher_type)) != NULL); +#if !defined(MBEDTLS_DEPRECATED_REMOVED) TEST_LE_U(mbedtls_cipher_info_get_block_size(cipher_info), MBEDTLS_CIPHER_BLKSIZE_MAX); +#endif /* MBEDTLS_DEPRECATED_REMOVED */ TEST_LE_U(mbedtls_cipher_info_get_block_size(cipher_info), MBEDTLS_CMAC_MAX_BLOCK_SIZE);