cipher_wrap: fix guards for alloc/free functions of CCM/GCM

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
This commit is contained in:
Valerio Setti 2023-12-19 11:17:14 +01:00
parent 4a8ef7cd9b
commit 50333977c6

View file

@ -114,7 +114,9 @@ enum mbedtls_cipher_base_index {
MBEDTLS_CIPHER_BASE_PREVENT_EMPTY_ENUM
};
#if defined(MBEDTLS_GCM_C)
#if defined(MBEDTLS_GCM_C) && \
(defined(MBEDTLS_CIPHER_HAVE_GCM_AES_VIA_LEGACY_OR_USE_PSA) || \
defined(MBEDTLS_ARIA_C) || defined(MBEDTLS_CAMELLIA_C))
/* shared by all GCM ciphers */
static void *gcm_ctx_alloc(void)
{
@ -134,7 +136,9 @@ static void gcm_ctx_free(void *ctx)
}
#endif /* MBEDTLS_GCM_C */
#if defined(MBEDTLS_CCM_C)
#if defined(MBEDTLS_CCM_C) && \
(defined(MBEDTLS_CIPHER_HAVE_CCM_AES_VIA_LEGACY_OR_USE_PSA) || \
defined(MBEDTLS_ARIA_C) || defined(MBEDTLS_CAMELLIA_C))
/* shared by all CCM ciphers */
static void *ccm_ctx_alloc(void)
{