File: psa_memory_poisoning_wrappers.h

package info (click to toggle)
modsecurity 3.0.14-1
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 88,920 kB
  • sloc: ansic: 174,512; sh: 43,569; cpp: 26,214; python: 15,734; makefile: 3,864; yacc: 2,947; lex: 1,359; perl: 1,243; php: 42; tcl: 4
file content (40 lines) | stat: -rw-r--r-- 1,308 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/** Support for memory poisoning wrappers for PSA functions.
 *
 *  The wrappers poison the input and output buffers of each function
 *  before calling it, to ensure that it does not access the buffers
 *  except by calling the approved buffer-copying functions.
 *
 * This header declares support functions. The wrappers themselves are
 * decalred in the automatically generated file `test/psa_test_wrappers.h`.
 */
/*
 *  Copyright The Mbed TLS Contributors
 *  SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
 */

#ifndef PSA_MEMORY_POISONING_WRAPPERS_H
#define PSA_MEMORY_POISONING_WRAPPERS_H

#include "psa/crypto.h"

#include "test/memory.h"

#if defined(MBEDTLS_TEST_HOOKS) && defined(MBEDTLS_TEST_MEMORY_CAN_POISON)

/**
 * \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);

/**
 * \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);

#endif /* MBEDTLS_TEST_HOOKS && MBEDTLS_TEST_MEMORY_CAN_POISON */

#endif /* PSA_MEMORY_POISONING_WRAPPERS_H */