| Gilles Peskine | 3587dfd | 2021-09-20 19:20:04 +0200 | [diff] [blame] | 1 | /* 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 Rodgman | 16799db | 2023-11-02 19:47:20 +0000 | [diff] [blame] | 10 | * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later |
| Gilles Peskine | 3587dfd | 2021-09-20 19:20:04 +0200 | [diff] [blame] | 11 | */ |
| 12 | |
| Gilles Peskine | a08def9 | 2023-04-28 21:01:49 +0200 | [diff] [blame] | 13 | #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> |
| 25 | int mbedtls_test_inject_entropy_seed_read(unsigned char *buf, size_t len); |
| 26 | int 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 */ |