mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-04-16 08:42:50 +00: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:
parent
0f06bde936
commit
2de5abf284
@ -16,7 +16,8 @@
|
|||||||
#include <psa/crypto.h>
|
#include <psa/crypto.h>
|
||||||
#endif
|
#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"
|
#include "test/psa_memory_poisoning_wrappers.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -34,6 +34,7 @@ int mbedtls_test_platform_setup(void)
|
|||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
#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) \
|
||||||
&& defined(MBEDTLS_TEST_MEMORY_CAN_POISON)
|
&& defined(MBEDTLS_TEST_MEMORY_CAN_POISON)
|
||||||
mbedtls_poison_test_hooks_setup();
|
mbedtls_poison_test_hooks_setup();
|
||||||
#endif
|
#endif
|
||||||
@ -59,6 +60,7 @@ int mbedtls_test_platform_setup(void)
|
|||||||
void mbedtls_test_platform_teardown(void)
|
void mbedtls_test_platform_teardown(void)
|
||||||
{
|
{
|
||||||
#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) \
|
||||||
&& defined(MBEDTLS_TEST_MEMORY_CAN_POISON)
|
&& defined(MBEDTLS_TEST_MEMORY_CAN_POISON)
|
||||||
mbedtls_poison_test_hooks_teardown();
|
mbedtls_poison_test_hooks_teardown();
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user