1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-30 22:43:08 +03:00

Only poison memory when buffer copying is enabled

Make sure that we don't enable memory poisoning when
MBEDTLS_PSA_COPY_CALLER_BUFFERS is disabled.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
This commit is contained in:
David Horstmann
2023-12-20 11:26:40 +00:00
parent dda52ae1c6
commit 5d05b47844
2 changed files with 4 additions and 1 deletions

View File

@ -21,7 +21,8 @@
#include "mbedtls/psa_util.h"
#endif
#if defined(MBEDTLS_TEST_HOOKS) && defined(MBEDTLS_PSA_CRYPTO_C)
#if defined(MBEDTLS_TEST_HOOKS) && defined(MBEDTLS_PSA_CRYPTO_C) \
&& defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
#include "test/psa_memory_poisoning_wrappers.h"
#endif

View File

@ -51,6 +51,7 @@ int mbedtls_test_platform_setup(void)
int ret = 0;
#if defined(MBEDTLS_TEST_HOOKS) && defined(MBEDTLS_PSA_CRYPTO_C) \
&& defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) \
&& defined(MBEDTLS_TEST_MEMORY_CAN_POISON)
mbedtls_poison_test_hooks_setup();
#endif
@ -76,6 +77,7 @@ int mbedtls_test_platform_setup(void)
void mbedtls_test_platform_teardown(void)
{
#if defined(MBEDTLS_TEST_HOOKS) && defined(MBEDTLS_PSA_CRYPTO_C) \
&& defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) \
&& defined(MBEDTLS_TEST_MEMORY_CAN_POISON)
mbedtls_poison_test_hooks_teardown();
#endif