Vendor: libssh2 project · https://www.libssh2.org/ · pkg:generic/libssh2 · Last reviewed 2026-12-05 · History
Summary
- Hybrid ML-KEM key exchange is in progress: merged in the development branch (
1.11.2_DEV), not in any release; the newest release, 1.11.1 (2024-10-16), has no post-quantum key exchange entry.123 - In the development branch
mlkem768x25519-sha256,mlkem768nistp256-sha256andmlkem1024nistp384-sha384(all hybrid) are listed first, so default when built with OpenSSL 3.5 or later.345 - No other backend gets them: the mbedTLS, libgcrypt, WinCNG and OS400 QC3 headers define
LIBSSH2_MLKEMas 0, and the OpenSSL header excludes LibreSSL and wolfSSL.56 - Host keys are classical; a commit message says ML-DSA host keys are “not used or supported by libssh2”.7
- Classical key exchange can be disabled by the application with
libssh2_session_method_pref();sntrup761x25519-sha512is requested (open since 2023-05-15).89
A released libssh2 cannot offer post-quantum key exchange until a release is cut from the development branch that merged it on 2026-04-03 (checked 2026-12-05).1310
Cryptographic operations
- Key exchange: libssh is a different project; libssh2 is a client-only SSH library and a backend of curl (selection not covered).1 Default order in the development branch at commit 5a3462b1 (2026-12-04):4
mlkem768x25519-sha256, mlkem768nistp256-sha256, mlkem1024nistp384-sha384,
curve25519-sha256, curve25519-sha256@libssh.org,
ecdh-sha2-nistp256, ecdh-sha2-nistp384, ecdh-sha2-nistp521,
diffie-hellman-group-exchange-sha256,
diffie-hellman-group16-sha512, diffie-hellman-group18-sha512,
diffie-hellman-group14-sha256
- The first three are hybrid: ML-KEM-768 with X25519, ML-KEM-768 with P-256, ML-KEM-1024 with P-384; see mlkem768x25519-sha256. The rest are classical. ML-KEM entries exist only if the build defines
LIBSSH2_MLKEM, and the x25519 hybrid also needsLIBSSH2_ED25519; SHA-1 key exchanges only withLIBSSH2_KEX_SHA1_ENABLE.45 - Pull request 1644: adds the three algorithms “according to draft-ietf-sshm-mlkem-hybrid-kex if libssh2 built against OpenSSL 3.5 or newer.”10
- Host authentication: host key types listed on the home page are
ssh-ed25519,ssh-ed25519-cert-v01@openssh.com,ecdsa-sha2-nistp521,ecdsa-sha2-nistp384,ecdsa-sha2-nistp256,ssh-rsa,ssh-dss, all classical; the development branch disables SHA-1ssh-rsaandssh-dssunless enabled at build.111
Versions
| Change | Version or date | Package URL | Source |
|---|---|---|---|
| Latest release; no post-quantum key exchange on the project page | 1.11.1, 2024-10-16 | pkg:generic/libssh2@1.11.1 |
1 |
| Hybrid ML-KEM key exchange, OpenSSL 3.5 or later only: “src: add hybrid ML-KEM KEX algorithms support with OpenSSL 3.5 (3ba252e2 #1644)” | development branch, merged 2026-04-03, not released | no release; commit 3ba252e2 | 310 |
Configuration
Enabling PQC
Not possible with a released libssh2 (checked 2026-12-05); with a development build, link against OpenSSL 3.5 or later, no application change.45
Disabling classical algorithms
- No libssh2 switch; the application sets the list before the handshake, “Coma delimited list of preferred methods to use with the most preferred listed first”; an unsupported method “is ignored and not sent to the remote host”.
LIBSSH2_METHOD_KEXselects key exchange.812
libssh2_session_method_pref(session, LIBSSH2_METHOD_KEX,
"mlkem768x25519-sha256,mlkem768nistp256-sha256");
- A server supporting none of them cannot connect; whether a program exposes the call is up to the program.
References
-
libssh2 home page: “libssh2 is a client-side C library implementing the SSH2 protocol”, features and “Download libssh2 1.11.1, released on 2024-10-16”. https://www.libssh2.org/ (accessed 2026-12-05) ↩ ↩2 ↩3 ↩4 ↩5
-
libssh2
RELEASE-NOTES, commit 5a3462b1 (2026-12-04), header “libssh2 1.11.2_DEV”. https://github.com/libssh2/libssh2/blob/5a3462b198e41b39616736114cd8a7cd923dabc8/RELEASE-NOTES (accessed 2026-12-05) ↩ -
libssh2
RELEASE-NOTES, entry “src: add hybrid ML-KEM KEX algorithms support with OpenSSL 3.5 (3ba252e2 #1644)”. https://github.com/libssh2/libssh2/blob/5a3462b198e41b39616736114cd8a7cd923dabc8/RELEASE-NOTES (accessed 2026-12-05) ↩ ↩2 ↩3 ↩4 -
libssh2
src/kex.c,kex_methods[], commit 5a3462b1. https://github.com/libssh2/libssh2/blob/5a3462b198e41b39616736114cd8a7cd923dabc8/src/kex.c#L2880-L2909 (accessed 2026-12-05) ↩ ↩2 ↩3 ↩4 -
libssh2
src/openssl.h, definition ofLIBSSH2_MLKEM, commit 5a3462b1. https://github.com/libssh2/libssh2/blob/5a3462b198e41b39616736114cd8a7cd923dabc8/src/openssl.h#L165-L171 (accessed 2026-12-05) ↩ ↩2 ↩3 ↩4 -
libssh2
src/mbedtls.h,src/libgcrypt.h,src/wincng.h,src/os400qc3.h:#define LIBSSH2_MLKEM 0, commit 5a3462b1. https://github.com/libssh2/libssh2/blob/5a3462b198e41b39616736114cd8a7cd923dabc8/src/mbedtls.h (accessed 2026-12-05) ↩ -
libssh2 pull request 2615, “tests: add ML-DSA host keys (not used or supported by libssh2)”, 2026-09-13; issue search for ML-DSA. https://github.com/libssh2/libssh2/pull/2615 (accessed 2026-12-05) ↩ ↩2
-
libssh2
docs/libssh2_session_method_pref.md, commit 5a3462b1. https://github.com/libssh2/libssh2/blob/5a3462b198e41b39616736114cd8a7cd923dabc8/docs/libssh2_session_method_pref.md (accessed 2026-12-05) ↩ ↩2 -
libssh2 issue 1040, “sntrup761x25519-sha512”, opened 2023-05-15. https://github.com/libssh2/libssh2/issues/1040 (accessed 2026-12-05) ↩ ↩2
-
libssh2 pull request 1644, “Hybrid ML-KEM KEX algorithms support with OpenSSL 3.5”, merged 2026-04-03. https://github.com/libssh2/libssh2/pull/1644 (accessed 2026-12-05) ↩ ↩2 ↩3
-
libssh2
RELEASE-NOTES, deprecation notices for the 1.11.2_DEV development branch. https://github.com/libssh2/libssh2/blob/5a3462b198e41b39616736114cd8a7cd923dabc8/RELEASE-NOTES (accessed 2026-12-05) ↩ -
libssh2
include/libssh2.h,LIBSSH2_METHOD_KEX, commit 5a3462b1. https://github.com/libssh2/libssh2/blob/5a3462b198e41b39616736114cd8a7cd923dabc8/include/libssh2.h (accessed 2026-12-05) ↩ -
libssh2 pull request 2230. https://github.com/libssh2/libssh2/pull/2230 (accessed 2026-12-05) ↩