From 2940c9503eea25006fd47d42cfcafce7b4238a28 Mon Sep 17 00:00:00 2001 From: Eric Gu Date: Sun, 12 Jul 2026 17:07:29 -0400 Subject: [PATCH] Fix broken OpenSSL version check for IPv6 proxy in check_proxy() (#3095) check_proxy() gated IPv6 proxy support on a home-grown version check ${OSSL_VER_MAJOR$}${OSSL_VER_MINOR} -ge 11 at two places, which had a stray "$" causing a "bad substitution" error. On non-LibreSSL builds this aborted the rest of check_proxy() for any IPv6 proxy (literal [addr]:port, or a hostname resolving only to AAAA), so PROXY was never rebuilt into a valid "-proxy ..." argument and downstream openssl calls failed with an error mentioning neither IPv6 nor the proxy. Beyond the typo, the concatenation approach was itself unsound: OSSL_VER_MINOR carries the patch component (e.g. "1.1" for OpenSSL 1.1.1), so ${OSSL_VER_MAJOR}${OSSL_VER_MINOR} yields "11.1" and [[ 11.1 -ge 11 ]] is an arithmetic error. Replace both checks with the dotted-glob idiom used everywhere else in the file for OpenSSL >= 1.1 gates (e.g. testssl.sh:21441, :8216), which is robust and greppable. --- testssl.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testssl.sh b/testssl.sh index 39ce9f4..b27b1ad 100755 --- a/testssl.sh +++ b/testssl.sh @@ -23415,7 +23415,7 @@ check_proxy() { PROXYIP="$PROXYNODE" else # This was tested with vanilla OpenSSL versions - if [[ ${OSSL_VER_MAJOR$}${OSSL_VER_MINOR} -ge 11 ]]; then + if [[ $OSSL_VER_MAJOR -ge 3 ]] || [[ "$OSSL_VER_MAJOR.$OSSL_VER_MINOR" == 1.1.* ]]; then PROXYIP="[$PROXYNODE]" else fatal_cmd_line "OpenSSL version >= 1.1.0 required for IPv6 proxy support" $ERR_OSSLBIN @@ -23428,7 +23428,7 @@ check_proxy() { if [[ -z "$PROXYIP" ]]; then PROXYIP="$(get_aaaa_record "$PROXYNODE" 2>/dev/null | grep -v alias | sed 's/^.*address //')" if [[ -n "$PROXYIP" ]]; then - if [[ ${OSSL_VER_MAJOR$}${OSSL_VER_MINOR} -lt 11 ]]; then + if [[ $OSSL_VER_MAJOR -lt 3 ]] && [[ "$OSSL_VER_MAJOR.$OSSL_VER_MINOR" != 1.1.* ]]; then fatal_cmd_line "OpenSSL version >= 1.1.0 required for IPv6 proxy support" $ERR_OSSLBIN fi fi