diff --git a/testssl.sh b/testssl.sh index 0981f67..4db8daf 100755 --- a/testssl.sh +++ b/testssl.sh @@ -10687,6 +10687,7 @@ test_openssl_suffix() { find_openssl_binary() { local s_client_has=$TEMPDIR/s_client_has.txt local s_client_starttls_has=$TEMPDIR/s_client_starttls_has.txt + local openssl_location cwd="" # 0. check environment variable whether it's executable if [[ -n "$OPENSSL" ]] && [[ ! -x "$OPENSSL" ]]; then @@ -10733,6 +10734,18 @@ find_openssl_binary() { initialize_engine + openssl_location="$(which $OPENSSL)" + [[ -n "$GIT_REL" ]] && \ + cwd="$(/bin/pwd)" || \ + cwd="$RUN_DIR" + if [[ "$openssl_location" =~ $(/bin/pwd)/bin ]]; then + OPENSSL_LOCATION="\$PWD/bin/$(basename "$openssl_location")" + elif [[ "$openssl_location" =~ $cwd ]] && [[ "$cwd" != '.' ]]; then + OPENSSL_LOCATION="${openssl_location%%$cwd}" + else + OPENSSL_LOCATION="$openssl_location" + fi + OPENSSL_NR_CIPHERS=$(count_ciphers "$($OPENSSL ciphers 'ALL:COMPLEMENTOFALL:@STRENGTH' 2>/dev/null)") $OPENSSL s_client -ssl2 -connect x 2>&1 | grep -aq "unknown option" || \ @@ -11067,8 +11080,6 @@ prepare_arrays() { mybanner() { local idtag local bb1 bb2 bb3 - local openssl_location="$(which $OPENSSL)" - local cwd="" "$QUIET" && return "$CHILD_MASS_TESTING" && return @@ -11111,17 +11122,6 @@ EOF outln "\n" outln " Using \"$($OPENSSL version 2>/dev/null)\" [~$OPENSSL_NR_CIPHERS ciphers]" out " on $HNAME:" - - [[ -n "$GIT_REL" ]] && \ - cwd="$(/bin/pwd)" || \ - cwd="$RUN_DIR" - if [[ "$openssl_location" =~ $(/bin/pwd)/bin ]]; then - OPENSSL_LOCATION="\$PWD/bin/$(basename "$openssl_location")" - elif [[ "$openssl_location" =~ $cwd ]] && [[ "$cwd" != '.' ]]; then - OPENSSL_LOCATION="${openssl_location%%$cwd}" - else - OPENSSL_LOCATION="$openssl_location" - fi outln "$OPENSSL_LOCATION" outln " (built: \"$OSSL_BUILD_DATE\", platform: \"$OSSL_VER_PLATFORM\")\n" }