From 717573f44ed5ab8c14adfd30c97dadd0b8b2a173 Mon Sep 17 00:00:00 2001 From: Krzysztof Stachowiak Date: Thu, 29 Mar 2018 11:53:50 +0200 Subject: [PATCH 1/2] Add an NV_SEED test to the config adjustment script --- features/mbedtls/importer/adjust-config.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/features/mbedtls/importer/adjust-config.sh b/features/mbedtls/importer/adjust-config.sh index a41cf72dcf..51a3463ac1 100755 --- a/features/mbedtls/importer/adjust-config.sh +++ b/features/mbedtls/importer/adjust-config.sh @@ -66,7 +66,8 @@ add_code "#endif\n" \ "\n" \ "#if defined(MBEDTLS_SSL_TLS_C) && !defined(MBEDTLS_TEST_NULL_ENTROPY) && \\\\\n" \ - " !defined(MBEDTLS_ENTROPY_HARDWARE_ALT)\n" \ + " !defined(MBEDTLS_ENTROPY_HARDWARE_ALT) && \\\\\n" \ + " !defined(MBEDTLS_ENTROPY_NV_SEED)\n" \ "#error \"No entropy source was found at build time, so TLS \" \\\\\n" \ " \"functionality is not available\"\n" \ "#endif\n" From ebb28b32afdcaf54e77e339938aa9a1f44aafaf9 Mon Sep 17 00:00:00 2001 From: Krzysztof Stachowiak Date: Thu, 29 Mar 2018 15:07:29 +0200 Subject: [PATCH 2/2] Move the new check into the end of the previous line --- features/mbedtls/importer/adjust-config.sh | 29 +++++++++++----------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/features/mbedtls/importer/adjust-config.sh b/features/mbedtls/importer/adjust-config.sh index 51a3463ac1..751c90a3f6 100755 --- a/features/mbedtls/importer/adjust-config.sh +++ b/features/mbedtls/importer/adjust-config.sh @@ -55,21 +55,20 @@ add_code "\n" \ "#else\n" -add_code \ - "#include \"check_config.h\"\n" \ - "\n" \ - "#endif \/* !MBEDTLS_ENTROPY_HARDWARE_ALT && !MBEDTLS_TEST_NULL_ENTROPY *\/\n" \ - "\n" \ - "#if defined(MBEDTLS_TEST_NULL_ENTROPY)\n" \ - "#warning \"MBEDTLS_TEST_NULL_ENTROPY has been enabled. This \" \\\\\n" \ - " \"configuration is not secure and is not suitable for production use\"\n" \ - "#endif\n" \ - "\n" \ - "#if defined(MBEDTLS_SSL_TLS_C) && !defined(MBEDTLS_TEST_NULL_ENTROPY) && \\\\\n" \ - " !defined(MBEDTLS_ENTROPY_HARDWARE_ALT) && \\\\\n" \ - " !defined(MBEDTLS_ENTROPY_NV_SEED)\n" \ - "#error \"No entropy source was found at build time, so TLS \" \\\\\n" \ - " \"functionality is not available\"\n" \ +add_code \ + "#include \"check_config.h\"\n" \ + "\n" \ + "#endif \/* !MBEDTLS_ENTROPY_HARDWARE_ALT && !MBEDTLS_TEST_NULL_ENTROPY *\/\n" \ + "\n" \ + "#if defined(MBEDTLS_TEST_NULL_ENTROPY)\n" \ + "#warning \"MBEDTLS_TEST_NULL_ENTROPY has been enabled. This \" \\\\\n" \ + " \"configuration is not secure and is not suitable for production use\"\n" \ + "#endif\n" \ + "\n" \ + "#if defined(MBEDTLS_SSL_TLS_C) && !defined(MBEDTLS_TEST_NULL_ENTROPY) && \\\\\n" \ + " !defined(MBEDTLS_ENTROPY_HARDWARE_ALT) && !defined(MBEDTLS_ENTROPY_NV_SEED)\n" \ + "#error \"No entropy source was found at build time, so TLS \" \\\\\n" \ + " \"functionality is not available\"\n" \ "#endif\n" # not supported on mbed OS, nor used by mbed Client