From 13303753ff23da8dc01103d57ca892eee529b9e9 Mon Sep 17 00:00:00 2001 From: Dirk Date: Sat, 31 Jul 2021 13:22:47 +0200 Subject: [PATCH 1/3] Disable ANSI codes for italic when TERM == screen ... otherwise it is being printed in reverse, see #1928. Same as #1946 but for the 3.0 branch. --- testssl.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/testssl.sh b/testssl.sh index 13fe49d..6a7dc58 100755 --- a/testssl.sh +++ b/testssl.sh @@ -597,7 +597,9 @@ pr_bold() { tm_bold "$1"; [[ "$COLOR" -ne 0 ]] && html_out " Date: Sat, 31 Jul 2021 18:27:03 +0200 Subject: [PATCH 2/3] Look-ahead trick for -U --ids-friendly If the order of the cmdline is '-U --ids-friendly' then we need to make sure we catch --ids-friendly. Normally we do not, see #1717. The following statement makes sure. In the do-while + case-esac loop the check for --ids-friendly will be executed again, but it does not hurt --- testssl.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/testssl.sh b/testssl.sh index 13fe49d..e496a39 100755 --- a/testssl.sh +++ b/testssl.sh @@ -19531,6 +19531,13 @@ parse_cmd_line() { do_client_simulation=true ;; -U|--vulnerable|--vulnerabilities) + # Lookahead function: If the order of the cmdline is '-U --ids-friendly' + # then we need to make sure we catch --ids-friendly. Normally we do not, + # see #1717. The following statement makes sure. In the do-while + case-esac + # loop it will be execute again, but it does not hurt + if [[ "${CMDLINE_ARRAY[@]}" =~ --ids-friendly ]]; then + OFFENSIVE=false + fi do_vulnerabilities=true do_heartbleed="$OFFENSIVE" do_ccs_injection="$OFFENSIVE" From 16c18789cdab263b90eff7789ff495460b3942d0 Mon Sep 17 00:00:00 2001 From: Dirk Wetter Date: Sun, 1 Aug 2021 18:25:13 +0200 Subject: [PATCH 3/3] Legacy removals + housekeeping * remove relics (CVS) * add diff to HTML CI run --- t/08_isHTML_valid.t | 5 +++++ testssl.sh | 10 ++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/t/08_isHTML_valid.t b/t/08_isHTML_valid.t index 48139b7..6d79d40 100755 --- a/t/08_isHTML_valid.t +++ b/t/08_isHTML_valid.t @@ -6,6 +6,7 @@ use strict; use Test::More; use Data::Dumper; +use Text::Diff; my $tests = 0; my $prg="./testssl.sh"; @@ -15,6 +16,7 @@ my $html=""; my $debughtml=""; my $edited_html=""; my $check2run="--ip=one --color 0 --htmlfile tmp.html"; +my $diff=""; die "Unable to open $prg" unless -f $prg; @@ -72,5 +74,8 @@ $debughtml =~ s/.*DEBUG:.*\n//g; cmp_ok($debughtml, "eq", $html, "HTML file created with --debug 4 matches HTML file created without --debug"); $tests++; +$diff = diff \$debughtml, \$html; +printf "\n%s\n", "$diff"; + printf "\n"; done_testing($tests); diff --git a/testssl.sh b/testssl.sh index 76ac9a4..37ae037 100755 --- a/testssl.sh +++ b/testssl.sh @@ -867,7 +867,7 @@ fileout_pretty_json_banner() { echo -e " \"Invocation\" : \"$PROG_NAME $CMDLINE\", \"at\" : \"$HNAME:$OPENSSL_LOCATION\", - \"version\" : \"$VERSION ${GIT_REL_SHORT:-$CVS_REL_SHORT} from $REL_DATE\", + \"version\" : \"$VERSION ${GIT_REL_SHORT} from $REL_DATE\", \"openssl\" : \"$OSSL_NAME $OSSL_VER from $OSSL_BUILD_DATE\", \"startTime\" : \"$START_TIME\", \"scanResult\" : [" @@ -1097,7 +1097,7 @@ html_banner() { if "$CHILD_MASS_TESTING" && "$HTMLHEADER"; then html_out "## Scan started as: \"$PROG_NAME $CMDLINE\"\n" html_out "## at $HNAME:$OPENSSL_LOCATION\n" - html_out "## version testssl: $VERSION ${GIT_REL_SHORT:-$CVS_REL_SHORT} from $REL_DATE\n" + html_out "## version testssl: $VERSION ${GIT_REL_SHORT} from $REL_DATE\n" html_out "## version openssl: \"$OSSL_NAME $OSSL_VER\" from \"$OSSL_BUILD_DATE\")\n\n" fi } @@ -1141,7 +1141,7 @@ prepare_logging() { fi tmln_out "## Scan started as: \"$PROG_NAME $CMDLINE\"" >>"$LOGFILE" tmln_out "## at $HNAME:$OPENSSL_LOCATION" >>"$LOGFILE" - tmln_out "## version testssl: $VERSION ${GIT_REL_SHORT:-$CVS_REL_SHORT} from $REL_DATE" >>"$LOGFILE" + tmln_out "## version testssl: $VERSION ${GIT_REL_SHORT} from $REL_DATE" >>"$LOGFILE" tmln_out "## version openssl: \"$OSSL_VER\" from \"$OSSL_BUILD_DATE\")\n" >>"$LOGFILE" exec > >(tee -a -i "$LOGFILE") } @@ -17507,9 +17507,7 @@ mybanner() { "$QUIET" && return "$CHILD_MASS_TESTING" && return OPENSSL_NR_CIPHERS=$(count_ciphers "$(actually_supported_osslciphers 'ALL:COMPLEMENTOFALL:@STRENGTH' 'ALL')") - [[ -z "$GIT_REL" ]] && \ - idtag="$CVS_REL" || \ - idtag="$GIT_REL -- $CVS_REL_SHORT" + [[ -n "$GIT_REL" ]] && idtag="$GIT_REL" bb1=$(cat <