blob: e543297e59d1bf2054d1f3d49a74295e7a7ed06a [file] [log] [blame]
Gilles Peskine3587dfd2021-09-20 19:20:04 +02001/* MBEDTLS_USER_CONFIG_FILE for testing.
2 * Only used for a few test configurations.
3 *
4 * Typical usage (note multiple levels of quoting):
5 * make CFLAGS="'-DMBEDTLS_USER_CONFIG_FILE=\"../tests/configs/user-config-for-test.h\"'"
6 */
7
8/*
9 * Copyright The Mbed TLS Contributors
Dave Rodgman16799db2023-11-02 19:47:20 +000010 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
Gilles Peskine3587dfd2021-09-20 19:20:04 +020011 */
12
Gilles Peskinea08def92023-04-28 21:01:49 +020013#if defined(MBEDTLS_PSA_INJECT_ENTROPY)
14/* The #MBEDTLS_PSA_INJECT_ENTROPY feature requires two extra platform
15 * functions, which must be configured as #MBEDTLS_PLATFORM_NV_SEED_READ_MACRO
16 * and #MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO. The job of these functions
17 * is to read and write from the entropy seed file, which is located
18 * in the PSA ITS file whose uid is #PSA_CRYPTO_ITS_RANDOM_SEED_UID.
19 * (These could have been provided as library functions, but for historical
20 * reasons, they weren't, and so each integrator has to provide a copy
21 * of these functions.)
22 *
23 * Provide implementations of these functions for testing. */
24#include <stddef.h>
25int mbedtls_test_inject_entropy_seed_read(unsigned char *buf, size_t len);
26int mbedtls_test_inject_entropy_seed_write(unsigned char *buf, size_t len);
27#define MBEDTLS_PLATFORM_NV_SEED_READ_MACRO mbedtls_test_inject_entropy_seed_read
28#define MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO mbedtls_test_inject_entropy_seed_write
29#endif /* MBEDTLS_PSA_INJECT_ENTROPY */