Skip to content

Fix broken OpenSSL version check for IPv6 proxy in check_proxy() (#3095)#3096

Merged
drwetter merged 1 commit into
testssl:3.3devfrom
ericcgu:fix/3095-ipv6-proxy-bad-substitution
Jul 14, 2026
Merged

Fix broken OpenSSL version check for IPv6 proxy in check_proxy() (#3095)#3096
drwetter merged 1 commit into
testssl:3.3devfrom
ericcgu:fix/3095-ipv6-proxy-bad-substitution

Conversation

@ericcgu

@ericcgu ericcgu commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

#3095

What is your pull request about?

  • Bug fix
  • Improvement
  • New feature (adds functionality)
  • Breaking change: bug fix, feature or improvement that would cause existing output (especially JSON, CSV) to not work as expected before
  • Typo / spelling fix
  • Documentation update
  • Update of other files

If it's a code change please check the boxes which are applicable

  • For the main program: My edits contain no tabs, indentation is five spaces and any line endings do not contain any blank chars
  • I've read CONTRIBUTING.md
  • My code follows Coding_Convention.md
  • I have tested this fix or improvement against >=2 hosts and I couldn't spot a problem
  • I have tested this new feature against >=2 hosts which show this feature and >=2 host which does not (in order to avoid side effects) . I couldn't spot a problem
  • For the new feature I have made corresponding changes to the documentation and / or to help()
  • If it's a bigger change: I added myself to CREDITS.md (alphabetical order) and the change to CHANGELOG.md

AI section

  • "I" found a bug using LLM version: [e.g. GPT-A.B, Claude <NAME> A.B, Gemini A.B <NAME>, Qwen<B>-Coder, DeepSeek-<A> etc.]
  • My contribution does not include any AI-generated content
  • My contribution includes AI-generated content, as disclosed below:
    • AI Tools: [e.g. GitHub CoPilot, JetBrains Junie, VS Code plugin <NAME> etc.]
    • LLMs and versions: [e.g. GPT-A.B, Claude <NAME> A.B, Gemini A.B <NAME>, Qwen<B>-Coder, DeepSeek-<A> etc.]

…tssl#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.
@ericcgu ericcgu marked this pull request as ready for review July 13, 2026 02:42
@drwetter

Copy link
Copy Markdown
Collaborator

haven´t had the time yet to look into edit. Later today.

Changed the link to the issue for now

@drwetter

Copy link
Copy Markdown
Collaborator

@dcooper16 : if you feel like looking into it/merge it: pls go ahead

@drwetter drwetter merged commit 580bffe into testssl:3.3dev Jul 14, 2026
4 checks passed
@drwetter

Copy link
Copy Markdown
Collaborator

Thanks, @ericcgu !

That need to be fixed for 3.2 as well. Mind doing a PR?

@ericcgu

ericcgu commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

Yes no problem!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants