From 2dd04907e2dd6f4e403856b62eede1e7bc14efba Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Fri, 16 Nov 2018 17:27:29 +0000 Subject: [PATCH] Omit tests from ssl-opt.sh which force a disabled ciphersuite --- tests/ssl-opt.sh | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/tests/ssl-opt.sh b/tests/ssl-opt.sh index ce9aee28a..2e2f4f1ab 100755 --- a/tests/ssl-opt.sh +++ b/tests/ssl-opt.sh @@ -185,6 +185,12 @@ requires_config_value_at_most() { fi } +requires_ciphersuite_enabled() { + if [ -z "$($P_CLI --help | grep "$1")" ]; then + SKIP_NEXT="YES" + fi +} + # skip next test if OpenSSL doesn't support FALLBACK_SCSV requires_openssl_with_fallback_scsv() { if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then @@ -519,14 +525,6 @@ run_test() { SKIP_NEXT="YES" fi - # should we skip? - if [ "X$SKIP_NEXT" = "XYES" ]; then - SKIP_NEXT="NO" - echo "SKIP" - SKIPS=$(( $SKIPS + 1 )) - return - fi - # does this test use a proxy? if [ "X$1" = "X-p" ]; then PXY_CMD="$2" @@ -541,6 +539,26 @@ run_test() { CLI_EXPECT="$3" shift 3 + # Check if server forces ciphersuite + FORCE_CIPHERSUITE=$(echo "$SRV_CMD" | sed -n 's/^.*force_ciphersuite=\([a-zA-Z0-9\-]*\).*$/\1/p') + if [ ! -z "$FORCE_CIPHERSUITE" ]; then + requires_ciphersuite_enabled $FORCE_CIPHERSUITE + fi + + # Check if client forces ciphersuite + FORCE_CIPHERSUITE=$(echo "$CLI_CMD" | sed -n 's/^.*force_ciphersuite=\([a-zA-Z0-9\-]*\).*$/\1/p') + if [ ! -z "$FORCE_CIPHERSUITE" ]; then + requires_ciphersuite_enabled $FORCE_CIPHERSUITE + fi + + # should we skip? + if [ "X$SKIP_NEXT" = "XYES" ]; then + SKIP_NEXT="NO" + echo "SKIP" + SKIPS=$(( $SKIPS + 1 )) + return + fi + # fix client port if [ -n "$PXY_CMD" ]; then CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g )