2024-01-04 16:11:54 +00:00
|
|
|
/** Support for memory poisoning wrappers for PSA functions.
|
2023-12-08 12:09:04 +00:00
|
|
|
*
|
2024-01-04 16:11:54 +00:00
|
|
|
* The wrappers poison the input and output buffers of each function
|
2023-12-08 12:09:04 +00:00
|
|
|
* before calling it, to ensure that it does not access the buffers
|
|
|
|
* except by calling the approved buffer-copying functions.
|
2024-01-04 16:11:54 +00:00
|
|
|
*
|
|
|
|
* This header declares support functions. The wrappers themselves are
|
|
|
|
* decalred in the automatically generated file `test/psa_test_wrappers.h`.
|
2023-12-08 12:09:04 +00:00
|
|
|
*/
|
2023-12-07 18:34:49 +00:00
|
|
|
/*
|
|
|
|
* Copyright The Mbed TLS Contributors
|
|
|
|
* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
|
|
|
|
*/
|
|
|
|
|
2023-12-13 17:07:23 +00:00
|
|
|
#ifndef PSA_MEMORY_POISONING_WRAPPERS_H
|
|
|
|
#define PSA_MEMORY_POISONING_WRAPPERS_H
|
|
|
|
|
2023-11-27 17:32:47 +00:00
|
|
|
#include "psa/crypto.h"
|
|
|
|
|
|
|
|
#include "test/memory.h"
|
|
|
|
|
2023-12-13 17:07:23 +00:00
|
|
|
#if defined(MBEDTLS_TEST_HOOKS) && defined(MBEDTLS_TEST_MEMORY_CAN_POISON)
|
2023-11-28 15:21:56 +00:00
|
|
|
|
2023-12-13 17:07:23 +00:00
|
|
|
/**
|
|
|
|
* \brief Setup the memory poisoning test hooks used by
|
|
|
|
* psa_crypto_copy_input() and psa_crypto_copy_output() for
|
|
|
|
* memory poisoning.
|
|
|
|
*/
|
|
|
|
void mbedtls_poison_test_hooks_setup(void);
|
2023-11-28 15:21:56 +00:00
|
|
|
|
2023-12-13 17:07:23 +00:00
|
|
|
/**
|
|
|
|
* \brief Teardown the memory poisoning test hooks used by
|
|
|
|
* psa_crypto_copy_input() and psa_crypto_copy_output() for
|
|
|
|
* memory poisoning.
|
|
|
|
*/
|
|
|
|
void mbedtls_poison_test_hooks_teardown(void);
|
2023-11-28 15:21:56 +00:00
|
|
|
|
2023-12-13 17:07:23 +00:00
|
|
|
#endif /* MBEDTLS_TEST_HOOKS && MBEDTLS_TEST_MEMORY_CAN_POISON */
|
|
|
|
|
2023-12-14 17:17:20 +00:00
|
|
|
#endif /* PSA_MEMORY_POISONING_WRAPPERS_H */
|