Skip to content

Fix openssh version detection bug#444

Merged
EthanHeilman merged 2 commits into
mainfrom
fix-ver10detectopenssh
Jan 9, 2026
Merged

Fix openssh version detection bug#444
EthanHeilman merged 2 commits into
mainfrom
fix-ver10detectopenssh

Conversation

@EthanHeilman
Copy link
Copy Markdown
Member

This fixes minor bug in which we display a warning that the openssh version is lower than 8.1 for openssh versions greater than 10.0. This PR fixes this bug by comparing openssh versions correctly.

Fixes #441

@EthanHeilman EthanHeilman self-assigned this Jan 9, 2026
@github-actions github-actions Bot added the bug Something isn't working label Jan 9, 2026
@EthanHeilman EthanHeilman requested a review from Copilot January 9, 2026 18:41
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a version comparison bug where OpenSSH versions >= 10.0 were incorrectly identified as being less than 8.1 due to lexicographic string comparison (e.g., "10.0" < "8.1" as strings). The fix replaces string comparison with proper semantic version comparison using the golang.org/x/mod/semver package.

Key changes:

  • Replaced string comparison with semver.Compare for version checking
  • Added regression test for OpenSSH 10.0
  • Added comprehensive brute-force testing for versions 9.0-15.99
  • Added test parallelization for improved test performance

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.

File Description
main.go Implements semver-based version comparison, replaces string comparison logic, removes debug log statement
main_test.go Adds regression test for version 10.0, introduces brute-force testing, refactors test logic into reusable helper function, adds test parallelization
go.mod Adds golang.org/x/mod dependency for semver support
go.sum Updates checksums for new golang.org/x/mod dependency

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread main.go Outdated
Comment thread main_test.go Outdated
Comment thread main_test.go Outdated
@EthanHeilman EthanHeilman merged commit fab1a9e into main Jan 9, 2026
15 checks passed
renovate Bot added a commit to sdwilsh/ansible-playbooks that referenced this pull request Jan 19, 2026
##### [\`v0.12.0\`](https://github.com/openpubkey/opkssh/releases/tag/v0.12.0)

Main feature of this release is the audit command, which allows you to check server side configurations.  Read the docs here: <https://github.com/openpubkey/opkssh/blob/main/docs/audit.md>

##### Changes

- docs: warn that azure alias URI hardcodes the tenant ID [@TheToddLuci0](https://github.com/TheToddLuci0) ([#446](openpubkey/opkssh#446))
- docs: Add Keycloak docs [@sylvain-vq](https://github.com/sylvain-vq) ([#442](openpubkey/opkssh#442))

##### 🚀 Features

- feat: Audit command [@Basti-Fantasti](https://github.com/Basti-Fantasti) ([#396](openpubkey/opkssh#396))

##### 🐛 Bug Fixes

- Update hack.sh to use user ids as user ids, not group ids as user ids [@TheToddLuci0](https://github.com/TheToddLuci0) ([#447](openpubkey/opkssh#447))
- Fix openssh version detection bug [@EthanHeilman](https://github.com/EthanHeilman) ([#444](openpubkey/opkssh#444))
- fix(deps): Update Docker @[renovate\[bot\]](https://github.com/apps/renovate) ([#450](openpubkey/opkssh#450))
- fix(deps): Update actions/setup-go action to v6.2.0 @[renovate\[bot\]](https://github.com/apps/renovate) ([#449](openpubkey/opkssh#449))
renovate Bot added a commit to sdwilsh/ansible-playbooks that referenced this pull request Jan 20, 2026
##### [\`v0.12.0\`](https://github.com/openpubkey/opkssh/releases/tag/v0.12.0)

Main feature of this release is the audit command, which allows you to check server side configurations.  Read the docs here: <https://github.com/openpubkey/opkssh/blob/main/docs/audit.md>

##### Changes

- docs: warn that azure alias URI hardcodes the tenant ID [@TheToddLuci0](https://github.com/TheToddLuci0) ([#446](openpubkey/opkssh#446))
- docs: Add Keycloak docs [@sylvain-vq](https://github.com/sylvain-vq) ([#442](openpubkey/opkssh#442))

##### 🚀 Features

- feat: Audit command [@Basti-Fantasti](https://github.com/Basti-Fantasti) ([#396](openpubkey/opkssh#396))

##### 🐛 Bug Fixes

- Update hack.sh to use user ids as user ids, not group ids as user ids [@TheToddLuci0](https://github.com/TheToddLuci0) ([#447](openpubkey/opkssh#447))
- Fix openssh version detection bug [@EthanHeilman](https://github.com/EthanHeilman) ([#444](openpubkey/opkssh#444))
- fix(deps): Update Docker @[renovate\[bot\]](https://github.com/apps/renovate) ([#450](openpubkey/opkssh#450))
- fix(deps): Update actions/setup-go action to v6.2.0 @[renovate\[bot\]](https://github.com/apps/renovate) ([#449](openpubkey/opkssh#449))
sdwilsh pushed a commit to sdwilsh/ansible-playbooks that referenced this pull request Jan 20, 2026
##### [\`v0.12.0\`](https://github.com/openpubkey/opkssh/releases/tag/v0.12.0)

Main feature of this release is the audit command, which allows you to check server side configurations.  Read the docs here: <https://github.com/openpubkey/opkssh/blob/main/docs/audit.md>

##### Changes

- docs: warn that azure alias URI hardcodes the tenant ID [@TheToddLuci0](https://github.com/TheToddLuci0) ([#446](openpubkey/opkssh#446))
- docs: Add Keycloak docs [@sylvain-vq](https://github.com/sylvain-vq) ([#442](openpubkey/opkssh#442))

##### 🚀 Features

- feat: Audit command [@Basti-Fantasti](https://github.com/Basti-Fantasti) ([#396](openpubkey/opkssh#396))

##### 🐛 Bug Fixes

- Update hack.sh to use user ids as user ids, not group ids as user ids [@TheToddLuci0](https://github.com/TheToddLuci0) ([#447](openpubkey/opkssh#447))
- Fix openssh version detection bug [@EthanHeilman](https://github.com/EthanHeilman) ([#444](openpubkey/opkssh#444))
- fix(deps): Update Docker @[renovate\[bot\]](https://github.com/apps/renovate) ([#450](openpubkey/opkssh#450))
- fix(deps): Update actions/setup-go action to v6.2.0 @[renovate\[bot\]](https://github.com/apps/renovate) ([#449](openpubkey/opkssh#449))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SSH Version Check Failing on Debian 13

2 participants