From 6428f8d78e620c9c4853dd64b14d75b9ce941972 Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Fri, 22 Sep 2017 16:58:50 +0100 Subject: [PATCH] Let ssl-opt.sh gracefully fail is SSL_MAX_CONTENT_LEN is not 16384 Some tests in ssl-opt.sh require MBEDTLS_SSL_MAX_CONTENT_LEN to be set to its default value of 16384 to succeed. While ideally such a dependency should not exist, as a short-term remedy this commit adds a small check that will at least lead to graceful exit if that assumption is violated. --- tests/ssl-opt.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/ssl-opt.sh b/tests/ssl-opt.sh index 50b7d1536..4865043b2 100755 --- a/tests/ssl-opt.sh +++ b/tests/ssl-opt.sh @@ -1292,6 +1292,21 @@ run_test "Session resume using cache: openssl server" \ # Tests for Max Fragment Length extension +MAX_CONTENT_LEN_EXPECT='16384' +MAX_CONTENT_LEN_CONFIG=$( ../scripts/config.pl get MBEDTLS_SSL_MAX_CONTENT_LEN) + +if [ -n "$MAX_CONTENT_LEN_CONFIG" ] && [ "$MAX_CONTENT_LEN_CONFIG" -ne "$MAX_CONTENT_LEN_EXPECT" ]; then + printf "The ${CONFIG_H} file contains a value for the configuration of\n" + printf "MBEDTLS_SSL_MAX_CONTENT_LEN that is different from the script’s\n" + printf "test value of ${MAX_CONTENT_LEN_EXPECT}. \n" + printf "\n" + printf "The tests assume this value and if it changes, the tests in this\n" + printf "script should also be adjusted.\n" + printf "\n" + + exit 1 +fi + requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH run_test "Max fragment length: enabled, default" \ "$P_SRV debug_level=3" \