diff --git a/tests/compat.sh b/tests/compat.sh index 6ca88b977f..e7d2cb43c6 100755 --- a/tests/compat.sh +++ b/tests/compat.sh @@ -33,6 +33,7 @@ SRVMEM=0 : ${M_SRV:=../programs/ssl/ssl_server2} : ${M_CLI:=../programs/ssl/ssl_client2} : ${OPENSSL:=openssl} +: ${M_QUERY:=../programs/test/query_compile_time_config} : ${GNUTLS_CLI:=gnutls-cli} : ${GNUTLS_SERV:=gnutls-serv} @@ -993,6 +994,15 @@ else DOG_DELAY=10 fi +# `$M_QUERY MBEDTLS_PLATFORM_STD_NV_SEED_FILE` will return `"seedfile"` and +# `dd` will create file with double quotes. That's not expected, with `eval` +# we can remove double quotes +NV_SEED_FILE=$(eval "echo `$M_QUERY MBEDTLS_PLATFORM_STD_NV_SEED_FILE`") +if [ -n "$NV_SEED_FILE" ] && [ ! -f $NV_SEED_FILE ] +then + dd if=/dev/urandom of=$NV_SEED_FILE bs=64 count=1 2>/dev/null +fi + SKIP_NEXT="NO" trap cleanup INT TERM HUP diff --git a/tests/ssl-opt.sh b/tests/ssl-opt.sh index e6ad70ee72..e56c418dd6 100755 --- a/tests/ssl-opt.sh +++ b/tests/ssl-opt.sh @@ -337,11 +337,10 @@ get_config_value_or_default() { # Note that if the configuration is not defined or is defined to nothing, # the output of this function will be an empty string. if [ "$LIST_TESTS" -eq 0 ];then - ${P_SRV} "query_config=${1}" + ${P_QUERY} "${1}" else echo "1" fi - } requires_config_value_at_least() { @@ -2142,6 +2141,17 @@ CLI_OUT="cli_out.$$" PXY_OUT="pxy_out.$$" SESSION="session.$$" + +# `$P_QUERY MBEDTLS_PLATFORM_STD_NV_SEED_FILE` will return `"seedfile"` and +# `dd` will create file with double quotes. That's not expected, with `eval` +# we can remove double quotes +NV_SEED_FILE=$(eval "echo `$P_QUERY MBEDTLS_PLATFORM_STD_NV_SEED_FILE`") +if [ -n "$NV_SEED_FILE" ] && [ ! -f $NV_SEED_FILE ] +then + dd if=/dev/urandom of=$NV_SEED_FILE bs=64 count=1 2>/dev/null +fi + + SKIP_NEXT="NO" trap cleanup INT TERM HUP diff --git a/tests/suites/test_suite_ssl.function b/tests/suites/test_suite_ssl.function index c1cf9bab86..d6b4487f47 100644 --- a/tests/suites/test_suite_ssl.function +++ b/tests/suites/test_suite_ssl.function @@ -4248,6 +4248,8 @@ void raw_key_agreement_fail(int bad_server_ecdhe_key) &(server.socket), BUFFSIZE), 0); + USE_PSA_INIT(); + TEST_EQUAL(mbedtls_test_move_handshake_to_state( &(client.ssl), &(server.ssl), MBEDTLS_SSL_CLIENT_KEY_EXCHANGE), 0); @@ -4263,6 +4265,7 @@ void raw_key_agreement_fail(int bad_server_ecdhe_key) (client.ssl).handshake->xxdh_psa_peerkey[0] ^= 0x02; } + TEST_EQUAL(mbedtls_test_move_handshake_to_state( &(client.ssl), &(server.ssl), MBEDTLS_SSL_HANDSHAKE_OVER), bad_server_ecdhe_key ? MBEDTLS_ERR_SSL_HW_ACCEL_FAILED : 0);