Skip to content

Commit 0cf26eb

Browse files
author
Cruz Monrreal
authored
Merge pull request #7877 from TomoYamanaka/improve_nv_seed_of_tls
Improve the config ajustment script of TLS for ENTROPY_NV_SEED
2 parents 9deefe5 + 7c90a9e commit 0cf26eb

File tree

1 file changed

+31
-30
lines changed

1 file changed

+31
-30
lines changed

features/mbedtls/importer/adjust-config.sh

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -37,38 +37,39 @@ add_code() {
3737

3838
# add an #ifndef to include config-no-entropy.h when the target does not have
3939
# an entropy source we can use.
40-
add_code \
41-
"#ifndef MBEDTLS_CONFIG_H\n" \
42-
"\n" \
43-
"#include \"platform\/inc\/platform_mbed.h\"\n" \
44-
"\n" \
45-
"\/*\n" \
46-
" * Only use features that do not require an entropy source when\n" \
47-
" * DEVICE_ENTROPY_SOURCE is not defined in mbed OS.\n" \
48-
" *\/\n" \
49-
"#if !defined(MBEDTLS_ENTROPY_HARDWARE_ALT) && !defined(MBEDTLS_TEST_NULL_ENTROPY)\n" \
50-
"#include \"mbedtls\/config-no-entropy.h\"\n" \
51-
"\n" \
52-
"#if defined(MBEDTLS_USER_CONFIG_FILE)\n" \
53-
"#include MBEDTLS_USER_CONFIG_FILE\n" \
54-
"#endif\n" \
55-
"\n" \
40+
add_code \
41+
"#ifndef MBEDTLS_CONFIG_H\n" \
42+
"\n" \
43+
"#include \"platform\/inc\/platform_mbed.h\"\n" \
44+
"\n" \
45+
"\/*\n" \
46+
" * Only use features that do not require an entropy source when\n" \
47+
" * DEVICE_ENTROPY_SOURCE is not defined in mbed OS.\n" \
48+
" *\/\n" \
49+
"#if !defined(MBEDTLS_ENTROPY_HARDWARE_ALT) && !defined(MBEDTLS_TEST_NULL_ENTROPY) && \\\\\n" \
50+
" !defined(MBEDTLS_ENTROPY_NV_SEED)\n" \
51+
"#include \"mbedtls\/config-no-entropy.h\"\n" \
52+
"\n" \
53+
"#if defined(MBEDTLS_USER_CONFIG_FILE)\n" \
54+
"#include MBEDTLS_USER_CONFIG_FILE\n" \
55+
"#endif\n" \
56+
"\n" \
5657
"#else\n"
5758

58-
add_code \
59-
"#include \"check_config.h\"\n" \
60-
"\n" \
61-
"#endif \/* !MBEDTLS_ENTROPY_HARDWARE_ALT && !MBEDTLS_TEST_NULL_ENTROPY *\/\n" \
62-
"\n" \
63-
"#if defined(MBEDTLS_TEST_NULL_ENTROPY)\n" \
64-
"#warning \"MBEDTLS_TEST_NULL_ENTROPY has been enabled. This \" \\\\\n" \
65-
" \"configuration is not secure and is not suitable for production use\"\n" \
66-
"#endif\n" \
67-
"\n" \
68-
"#if defined(MBEDTLS_SSL_TLS_C) && !defined(MBEDTLS_TEST_NULL_ENTROPY) && \\\\\n" \
69-
" !defined(MBEDTLS_ENTROPY_HARDWARE_ALT) && !defined(MBEDTLS_ENTROPY_NV_SEED)\n" \
70-
"#error \"No entropy source was found at build time, so TLS \" \\\\\n" \
71-
" \"functionality is not available\"\n" \
59+
add_code \
60+
"#include \"check_config.h\"\n" \
61+
"\n" \
62+
"#endif \/* !MBEDTLS_ENTROPY_HARDWARE_ALT && !MBEDTLS_TEST_NULL_ENTROPY && !MBEDTLS_ENTROPY_NV_SEED *\/\n" \
63+
"\n" \
64+
"#if defined(MBEDTLS_TEST_NULL_ENTROPY)\n" \
65+
"#warning \"MBEDTLS_TEST_NULL_ENTROPY has been enabled. This \" \\\\\n" \
66+
" \"configuration is not secure and is not suitable for production use\"\n" \
67+
"#endif\n" \
68+
"\n" \
69+
"#if defined(MBEDTLS_SSL_TLS_C) && !defined(MBEDTLS_TEST_NULL_ENTROPY) && \\\\\n" \
70+
" !defined(MBEDTLS_ENTROPY_HARDWARE_ALT) && !defined(MBEDTLS_ENTROPY_NV_SEED)\n" \
71+
"#error \"No entropy source was found at build time, so TLS \" \\\\\n" \
72+
" \"functionality is not available\"\n" \
7273
"#endif\n"
7374

7475
# not supported on mbed OS, nor used by mbed Client

0 commit comments

Comments
 (0)