Skip to content

Commit f674b2b

Browse files
Andres AGsimonbutcher
authored andcommitted
Remove TEST_NULL_ENTROPY definition from examples
Remove the definition of MBEDTLS_TEST_NULL_ENTROPY and MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES whenever there is no entropy source defined for the target platform. In the case of the tls-client, introduced a compile-time error message to ensure that the cause of the failure is clear.
1 parent 5c2cd48 commit f674b2b

File tree

3 files changed

+6
-48
lines changed

3 files changed

+6
-48
lines changed

benchmark/mbed_app.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"macros": ["MBEDTLS_USER_CONFIG_FILE=\"mbedtls_entropy_config.h\"", "OS_MAINSTKSIZE=2048"]
2+
"macros": ["OS_MAINSTKSIZE=2048"]
33
}

benchmark/mbedtls_entropy_config.h

Lines changed: 0 additions & 32 deletions
This file was deleted.

tls-client/mbedtls_entropy_config.h

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,11 @@
1717
* This file is part of mbed TLS (https://tls.mbed.org)
1818
*/
1919

20-
#if !defined(MBEDTLS_ENTROPY_HARDWARE_ALT) && !defined(MBEDTLS_ENTROPY_NV_SEED)
21-
22-
#if !defined(MBEDTLS_TEST_NULL_ENTROPY)
23-
#warning \
24-
"THIS HARDWARE DOES NOT HAVE ENTROPY. DISABLING MBED TLS SECURITY " \
25-
"FEATURE."
26-
#define MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
27-
#define MBEDTLS_TEST_NULL_ENTROPY
28-
#endif /* !MBEDTLS_TEST_NULL_ENTROPY */
29-
30-
#warning \
31-
"MBED TLS SECURITY FEATURE IS DISABLED. THE TESTS WILL NOT BE SECURE! " \
32-
"PLEASE IMPLEMENT HARDWARE ENTROPY FOR YOUR SELECTED HARDWARE."
33-
34-
#endif /* !MBEDTLS_ENTROPY_HARDWARE_ALT && !MBEDTLS_ENTROPY_NV_SEED */
20+
#if !defined(MBEDTLS_ENTROPY_HARDWARE_ALT) && \
21+
!defined(MBEDTLS_ENTROPY_NV_SEED) && !defined(MBEDTLS_TEST_NULL_ENTROPY)
22+
#error "This hardware does not have an entropy source."
23+
#endif /* !MBEDTLS_ENTROPY_HARDWARE_ALT && !MBEDTLS_ENTROPY_NV_SEED &&
24+
* !MBEDTLS_TEST_NULL_ENTROPY */
3525

3626
#define MBEDTLS_SHA1_C
3727

0 commit comments

Comments
 (0)