Skip to content

GHA: stop running tests with Libgcrypt - #1720

Closed
vszakats wants to merge 4 commits into
libssh2:masterfrom
vszakats:pin-debian
Closed

vszakats wants to merge 4 commits into
libssh2:masterfrom
vszakats:pin-debian

Conversation

@vszakats

@vszakats vszakats commented Oct 13, 2025 •

Copy link
Copy Markdown
Member

Tests started failing after touching sshd_config, which bumped
the test container from Debian Bookworm to Trixie, and openssh-server
from 9.2p1 to 10.0p1 with it. OpenSSH v10 no longer supports legacy KEX
algos diffie-hellman-group* and diffie-hellman-group-exchange-*,
making libssh2 require ECDSA or ED25519 to enable curve25519-sha256*
or ecdh-sha2-*, for the tests to succeed.

libgcrypt, stock Ubuntu wolfSSL, and WinCNG CI jobs broke.

  • ED25519 is only supported with OpenSSL and LibreSSL 3.7+.
  • ECDSA is supported by OpenSSL and mbedTLS (unless disabled),
    by wolfSSL in certain cases (but not on Ubuntu 24.04 with the stock
    v5.6.6 build), and by WinCNG when explicitly enabled, and targeting
    Windows 10/2016 Server.

Fixed by:

An alternate option is to downgrade to Bookworm, with the undesired
effect that its openssh-server doesn't support ML-KEM and other modern
SSH features, meaning those could not be tested once implemented in
libssh2, e.g. in #1644.

Ref: https://www.openssh.com/txt/release-10.0
Ref: https://packages.debian.org/trixie/openssh-server
Ref: https://packages.debian.org/bookworm/openssh-server
Ref: https://packages.ubuntu.com/noble/libwolfssl-dev

Bug: #1718 (comment)
Follow-up to 4f9e6e0 #1718


Rant: I find it super annoying that each time this breaks (which is: frequently),
all the error message says is "-5 unable to exchange keys", without any
specifics about what was offered by the server, and libssh2 itself, and what
was the issue in more detail.

@vszakats vszakats added the tests label Oct 13, 2025
@vszakats vszakats changed the title Dockerfile: downgrade and pin to bookworm, enable Dependabot Dockerfile: downgrade and pin to Bookworm, enable Dependabot Oct 13, 2025
vszakats added a commit that referenced this pull request Oct 13, 2025
To make it work with OpenSSH v10 in Debian Trixie. ECDSA (or ED25519) is
required for for compatibility with the supported list of KEX algos in
OpenSSH v10. ECDSA support requires targeting Windows 10, equivalent
to Windows 2016 Server.

Also move Windows 2016 job to the last position:
Ref: b5e68bd #1461

Bug: https://ci.appveyor.com/project/libssh2org/libssh2/builds/52898449/job/t79v1xi531bq3nab
Ref: #1720

Closes #1721
vszakats added a commit that referenced this pull request Oct 13, 2025
Use `HAVE_ECC` as an indicator for ECDSA when building with wolfSSL.

Before this patch the OpenSSL macros were used, in particular
`OPENSSL_NO_EC`, which made ECDSA support disabled with certain
wolfSSL build configurations, e.g. the Ubuntu 24.04 one.

ECDSA is necessary to run tests with OpenSSH v10, e.g. on Debian Trixie.

Follow-up to b95e758 #666
Ref: #1720
Closes #1723
@vszakats vszakats changed the title Dockerfile: downgrade and pin to Bookworm, enable Dependabot GHA: stop running tests with Libgcrypt Oct 13, 2025
@vszakats vszakats closed this in 51f6259 Oct 13, 2025
@vszakats
vszakats deleted the pin-debian branch June 21, 2026 21:02
vszakats added a commit that referenced this pull request Jul 2, 2026
Use the last known good test container build, with debian:bookworm, for
Libgcrypt tests.

Also:
- disable running non-containerized sshd tests in the clang-tidy job,
  because it uses the latest Ubuntu (26.04) which, as debian-trixie,
  comes with a modern OpenSSH server that's incompatible with libssh2's
  Libgcrypt backend:
  ```
  26: [libssh2] 0.055233 Failure Event: -5 - Unable to exchange encryption keys
  26: libssh2_session_handshake failed (-5): Unable to exchange encryption keys
  26: not ok 2 - sshd-test_auth_pubkey_ok_ed25519
  26/44 Test #26: test_sshd .................................***Failed    0.58 sec
  # sshd executable: '/usr/sbin/sshd' (OpenSSH_10.2p1 Ubuntu)
  # sshd log: '/tmp/tmp.QdEw2bfbFE'
  # ssh executable: '/usr/bin/ssh' (OpenSSH_10.2p1 Ubuntu-2ubuntu3.2, OpenSSL 3.5.5 27 Jan 2026)
  # ssh log: '/tmp/tmp.TDLIzPY6zV'
  1..2
  ```
  Ref: https://github.com/libssh2/libssh2/actions/runs/28610019322/job/84839842924?pr=2174#step:25:18669
- run Libgcrypt jobs on ubuntu-24.04 (was: ubuntu-latest) to ensure it
  continues working after ubuntu-latest is bumped.

Ref: https://github.com/libssh2/libssh2/pkgs/container/ci_tests_openssh_server/409796170?tag=98199e448a94451491c4
Ref: #2049
Follow-up to 51f6259 #1720

Closes #2174
vszakats added a commit that referenced this pull request Aug 2, 2026
…ounds

Turns out this was the root cause of CI failures seen earlier, and then
worked around by reverting to older versions Docker and runner machines.

Replace/revert those workarounds by enabling the necessary legacy bits
in the test OpenSSH server configuration.

Follow-up to 8be5716 #2174
Follow-up to 51f6259 #1720

Closes #2484
vszakats added a commit that referenced this pull request Sep 13, 2026
To help debugging issues.

Also:
- bump sshd LogLevel to DEBUG1, for essential details.
- bump command output buffer in `run_command_varg()`
- drop redundant condition in `run_command_varg()`
- replace `BUFSIZ` with literal sizes in `run_command_varg()`.

After this patch it's showing this in the CI log for the libgcrypt
fallout that previously needed a long time to diagnose:
```
61: ---- sshd log ----
61: No matching private key for certificate: /etc/ssh/ssh_host_mldsa44-ed25519_key-cert.pub
61: Server listening on 0.0.0.0 port 22.
61: Server listening on :: port 22.
61: debug1: sshd-session version OpenSSH_10.5, OpenSSL 3.6.3 9 Jun 2026
61: Connection from 172.17.0.1 port 51878 on 172.17.0.2 port 22 rdomain ""
61: debug1: sshd-auth version OpenSSH_10.5, OpenSSL 3.6.3 9 Jun 2026 [preauth]
61: debug1: list_hostkey_types: rsa-sha2-512,rsa-sha2-256,ssh-rsa,[email protected],
[email protected],[email protected],ecdsa-sha2-nistp256,
[email protected],ssh-ed25519,[email protected] [preauth]
61: debug1: Local version string SSH-2.0-OpenSSH_10.5p1 Debian-1 [preauth]
61: debug1: Remote protocol version 2.0, remote software version libssh2_1.11.2_DEV [preauth]
61: debug1: compat_banner: no match: libssh2_1.11.2_DEV [preauth]
61: debug1: SSH2_MSG_KEXINIT sent [preauth]
61: debug1: SSH2_MSG_KEXINIT received [preauth]
61: debug1: kex: algorithm: (no match) [preauth]
61: Unable to negotiate with 172.17.0.1 port 51878: no matching key exchange method found.
Their offer: diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,
diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1,
diffie-hellman-group1-sha1,diffie-hellman-group-exchange-sha1,ext-info-c,
[email protected] [preauth]
[...]
61: ------------------
```

Follow-up to 1d0b86a #2484
Follow-up to 8be5716 #2174
Follow-up to 51f6259 #1720

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant