Skip to content

Commit 7e292fb

Browse files
authored
Merge pull request #2926 from andresag01/iotssl-1017-mbedtls_user_config-null_entopy
Fix mbedtls user config and null entropy
2 parents 4914535 + 916ce43 commit 7e292fb

File tree

1 file changed

+20
-15
lines changed

1 file changed

+20
-15
lines changed

features/mbedtls/importer/adjust-config.sh

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,28 @@ 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)\n" \
50-
"#include \"mbedtls\/config-no-entropy.h\"\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+
"#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" \
5156
"#else\n"
5257

53-
add_code \
54-
"#include \"check_config.h\"\n" \
55-
"\n" \
56-
"#endif \/* !MBEDTLS_ENTROPY_HARDWARE_ALT *\/"
58+
add_code \
59+
"#include \"check_config.h\"\n" \
60+
"\n" \
61+
"#endif \/* !MBEDTLS_ENTROPY_HARDWARE_ALT && !MBEDTLS_TEST_NULL_ENTROPY *\/"
5762

5863
# not supported on mbed OS, nor used by mbed Client
5964
conf unset MBEDTLS_NET_C

0 commit comments

Comments
 (0)