Repository navigation
Add FIPS-approved NIST P-curve key exchanges to the SSH proxy default - #1220
Merged
ameowlia merged 1 commit intoOct 28, 2026
Merged
Conversation
Contributor
Author
|
Thanks for the review — all three addressed:
KEX specs pass locally (ssh-proxy 2/2, sshd 4/4). Note: the full ssh-proxy suite still needs the expired fixtures/metron/* certs (expired 2026-09-12) regenerated — pre-existing on develop. |
The ssh-proxy and cell sshd default their key-exchange list to curve25519-sha256@libssh.org only when allowed_keyexchanges is unset. A FIPS-mode client (e.g. Go with GODEBUG=fips140=on, which removes curve25519) then shares no common key-exchange algorithm with the proxy and cf ssh fails at the handshake before authentication. Widen the default KEX list to add the FIPS-approved NIST P-curves (ecdh-sha2-nistp256/384/521), keeping curve25519 first so non-FIPS clients negotiate exactly as before. Operators can still override via diego.ssh_proxy.allowed_keyexchanges. x/crypto already registers the nistp curves, so no dependency bump is needed. - cmd/ssh-proxy/main.go: widen the default KEX list - cmd/sshd/main.go: mirror the same default on the cell daemon - cmd/ssh-proxy/main_test.go: update the default-KEX expectation to the quoted error format and add a regression test proving a nistp-only (FIPS-mode) client completes the handshake with no explicit config - cmd/sshd/main_test.go: mirror the same default-KEX expectation and add the matching nistp-only regression test for the cell daemon
Viktor-Velkov
force-pushed
the
ssh-proxy-fips-key-exchanges
branch
from
October 23, 2026 10:25
041f8a7 to
ece5c6e
Compare
ameowlia
approved these changes
Oct 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The SSH proxy and cell
sshddefault their key-exchange list tocurve25519-sha256@libssh.orgonly whendiego.ssh_proxy.allowed_keyexchangesis unset. A FIPS-mode client (e.g. Go with
GODEBUG=fips140=on, which removescurve25519) then shares no common key-exchange algorithm with the proxy, and
cf sshfails at the handshake before authentication.This widens the default KEX list to add the FIPS-approved NIST P-curves
(
ecdh-sha2-nistp256/384/521), keepingcurve25519first so non-FIPS clientsnegotiate exactly as before. Operators can still override via
diego.ssh_proxy.allowed_keyexchanges.Changes:
cmd/ssh-proxy/main.go— widen the default KEX list.cmd/sshd/main.go— mirror the same default on the cell daemon.cmd/ssh-proxy/main_test.go— update the existing default-KEX expectationand add a regression test proving a nistp-only (FIPS-mode) client completes
the handshake with no explicit config.
golang.org/x/cryptoalready registers the NIST P-curves, so no dependencybump is needed.
Fixes #1219
Related to #1135
Testing
go buildandgo vetpass forcmd/ssh-proxyandcmd/sshd.golang.org/x/cryptowith astandalone handshake harness: a nistp-only (FIPS-mode) client fails against a
curve25519-only server (reproducing the bug) and succeeds once the P-curves
are added, while a non-FIPS client continues to negotiate curve25519.
Note: when running the
diego-sshintegration suite locally ondevelop, thetests fail before reaching the handshake because the checked-in test fixtures
src/code.cloudfoundry.org/diego-ssh/cmd/ssh-proxy/fixtures/metron/*expired on2026-09-12 (
certificate has expired). This pre-existing fixture expiry isunrelated to this change — the same failure reproduces on a clean
developcheckout without these commits. Happy to regenerate those fixtures in a separate
PR if useful.
Backward Compatibility
Breaking Change? No
curve25519 remains first in the list, so existing non-FIPS clients negotiate it
unchanged; this only adds fallback algorithms. Safe to apply to all
deployments immediately.