diff --git a/testssl.sh b/testssl.sh index 4c8c475..74241eb 100755 --- a/testssl.sh +++ b/testssl.sh @@ -2619,6 +2619,10 @@ EOF # Test for TLS_FALLBACK_SCSV tls_fallback_scsv() { + local ret + + [ $VULN_COUNT -le $VULN_THRESHLD ] && outln && pr_blue "--> Testing for TLS_FALLBACK_SCSV Protection" && outln "\n" + pr_bold " TLS_FALLBACK_SCSV"; out " (RFC 7507) " # This isn't a vulnerability check per se, but checks for the existence of # the countermeasure to protect against protocol downgrade attacks. @@ -2629,33 +2633,24 @@ tls_fallback_scsv() { return 4 fi - # Set up a local temporary file in which to store OpenSSL's output... - local TEMP="/tmp" - if [ ! -z "$HOME" ] && [ -w "$HOME" ]; then - TEMP="$HOME" - fi - local scsv="$TEMP/.testssl_scsv-${NODEIP}-${PORT}.txt" - ret=1 - # ...and do the test - [ $VULN_COUNT -le $VULN_THRESHLD ] && outln && pr_blue "--> Testing for TLS_FALLBACK_SCSV Support" && outln "\n" - pr_bold " TLS_FALLBACK_SCSV"; out " (RFC 7507) " - echo | $OPENSSL s_client -connect $NODEIP:$PORT -no_tls1_2 -fallback_scsv > "$scsv" 2>&1 - if grep -q "CONNECTED(00" "$scsv"; then - if grep -q "alert inappropriate fallback" "$scsv"; then - pr_green "not vulnerable (OK) - supported" - ret=0 + $OPENSSL s_client -connect $NODEIP:$PORT $SNI -no_tls1_2 -fallback_scsv &>$TMPFILE