Skip to content

GHA: fix and re-enable Libgcrypt tests - #2174

Closed
vszakats wants to merge 6 commits into
libssh2:masterfrom
vszakats:libgt
Closed

vszakats wants to merge 6 commits into
libssh2:masterfrom
vszakats:libgt

Conversation

@vszakats

@vszakats vszakats commented Jul 2, 2026 •

Copy link
Copy Markdown
Member

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

vszakats added a commit that referenced this pull request Jul 2, 2026
Also bail out right away to avoid other issues down the line.

Seen in CI when Libgcrypt could not negotiate keys with modern sshd
server on Ubuntu 26.04:
```
26: 1..2
26: Failure establishing SSH session: -5
26: Fingerprint: /home/runner/tests/test_sshd.test: line 151:  8233 Segmentation fault
         (core dumped) ${LIBSSH2_TEST_EXE_RUNNER:-} "${test}"
26: not ok 1 - sshd-test_ssh2
26: libssh2_session_handshake failed (-5): Unable to exchange encryption keys
```
Ref: https://github.com/libssh2/libssh2/actions/runs/28582866680/job/84747161004?pr=2174

Ref: #2174

Closes #2179
vszakats added 4 commits July 2, 2026 19:41
To avoid:
```
test 26
      Start 26: test_sshd

26: Test command: /usr/bin/sh "-c" "/home/runner/work/libssh2/libssh2/tests/test_sshd.test  /home/runner/work/libssh2/libssh2/bld/tests/test_ssh2 /home/runner/work/libssh2/libssh2/bld/tests/test_auth_pubkey_ok_ed25519"
26: Working Directory: /home/runner/work/libssh2/libssh2/bld/tests
26: Environment variables:
26:  srcdir=/home/runner/work/libssh2/libssh2/tests
26:  SSHD=/usr/sbin/sshd
26: Test timeout computed to be: 10000000
26: # sshd executable: '/usr/sbin/sshd' (OpenSSH_10.2p1 Ubuntu)
26: # sshd log: '/tmp/tmp.FhzoiD6eOR'
26: # ssh executable: '/usr/bin/ssh' (OpenSSH_10.2p1 Ubuntu-2ubuntu3.2, OpenSSL 3.5.5 27 Jan 2026)
26: # ssh log: '/tmp/tmp.1dpXSksRzx'
26: 1..2
26: Failure establishing SSH session: -5
26: Fingerprint: /home/runner/work/libssh2/libssh2/tests/test_sshd.test: line 151:  8233 Segmentation fault         (core dumped) ${LIBSSH2_TEST_EXE_RUNNER:-} "${test}"
26: not ok 1 - sshd-test_ssh2
26: libssh2_session_handshake failed (-5): Unable to exchange encryption keys
26: Trace all enabled for connect_to_server.
26: not ok 2 - sshd-test_auth_pubkey_ok_ed25519
26/44 Test libssh2#26: test_sshd .................................***Failed    0.25 sec
1..2
Failure establishing SSH session: -5
Fingerprint: /home/runner/work/libssh2/libssh2/tests/test_sshd.test: line 151:  8233 Segmentation fault         (core dumped) ${LIBSSH2_TEST_EXE_RUNNER:-} "${test}"
not ok 1 - sshd-test_ssh2
libssh2_session_handshake failed (-5): Unable to exchange encryption keys
Trace all enabled for connect_to_server.
not ok 2 - sshd-test_auth_pubkey_ok_ed25519
```
Ref: https://github.com/libssh2/libssh2/actions/runs/28582866680/job/84747161004?pr=2174#step:25:469
@vszakats vszakats changed the title GHA: try restoring tests for Libgcrypt GHA: restore Libgcrypt tests Jul 2, 2026
@vszakats vszakats changed the title GHA: restore Libgcrypt tests GHA: fix and re-enable Libgcrypt tests Jul 2, 2026
@vszakats vszakats closed this in 8be5716 Jul 2, 2026
@vszakats
vszakats deleted the libgt branch July 2, 2026 18:25
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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant