diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2020-01-17 21:34:45 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2020-01-18 07:45:04 +0100 |
commit | 6f11aaffb420bbf58f631cb4a210e7fdc9a218c7 (patch) | |
tree | 23f7f9f92ecba82470d0dd892d8a3300e49da601 /tests | |
parent | 4023d63f0b2795c0c0447282c808671ae8503ac3 (diff) | |
download | gnutls-6f11aaffb420bbf58f631cb4a210e7fdc9a218c7.tar.gz |
gnutls-cli-debug: ignore tests when algorithms are unavailable
When gnutls-cli-debug is run on systems where a particular algorithm
is disabled, ensure that we don't stop the testing; in that case
we ignore the test.
Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/gnutls-cli-debug.sh | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/gnutls-cli-debug.sh b/tests/gnutls-cli-debug.sh index 51f77bb565..0ab6069b8f 100755 --- a/tests/gnutls-cli-debug.sh +++ b/tests/gnutls-cli-debug.sh @@ -24,6 +24,7 @@ srcdir="${srcdir:-.}" SERV="${SERV:-../src/gnutls-serv${EXEEXT}}" DCLI="${DCLI:-../src/gnutls-cli-debug${EXEEXT}}" OUTFILE=cli-debug.$$.tmp +TMPFILE=config.$$.tmp unset RETCODE if ! test -x "${SERV}"; then @@ -169,7 +170,36 @@ check_text "whether the server accepts default record size (512 bytes)... no" check_text "whether %ALLOW_SMALL_RECORDS is required... yes" check_text "for RSA key exchange support... no" +echo "" +echo "Checking output of gnutls-cli-debug when algorithms are disabled" +eval "${GETPORT}" +launch_server $$ --echo --priority "NORMAL:-VERS-ALL:+VERS-TLS1.3:+VERS-TLS1.2" --x509keyfile ${KEY1} --x509certfile ${CERT1} \ + --x509keyfile ${KEY2} --x509certfile ${CERT2} --x509keyfile ${KEY3} --x509certfile ${CERT3} >/dev/null 2>&1 +PID=$! +wait_server ${PID} + +cat <<_EOF_ > ${TMPFILE} +[overrides] + +tls-disabled-cipher = CAMELLIA-128-CBC +tls-disabled-cipher = CAMELLIA-256-CBC +_EOF_ +export GNUTLS_SYSTEM_PRIORITY_FILE="${TMPFILE}" + +timeout 1800 datefudge "2017-08-9" \ +"${DCLI}" -p "${PORT}" localhost >$OUTFILE 2>&1 || fail ${PID} "gnutls-cli-debug run should have succeeded!" + +unset GNUTLS_SYSTEM_PRIORITY_FILE + +kill ${PID} +wait + +check_text "for AES-GCM cipher (RFC5288) support... yes" +check_text "for RSA key exchange support... yes" +check_text "for SHA1 MAC support... yes" + rm -f ${OUTFILE} +rm -f ${TMPFILE} if test "${ENABLE_GOST}" = "1" && test "${GNUTLS_FORCE_FIPS_MODE}" != 1 ; then # GOST_CNT test |