Repository navigation
ssh: support hybrid ML-KEM768/X25519 key exchange - #797
Draft
Seanstoppable wants to merge 1 commit into
Draft
Seanstoppable wants to merge 1 commit into
Seanstoppable wants to merge 1 commit into
Conversation
|
Please @codyprime review the code! We need this PR! Thanks! |
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.
This PR was generated with the assistance of GitHub Copilot CLI and may require human review.
Port
mlkem768x25519-sha256fromgolang.org/x/crypto/sshv0.57.0 into the SSH fork so scans can negotiate with servers that only offer hybrid post-quantum key exchange.The port adapts upstream's implementation to the fork's per-connection instances and handshake logging, retains the upstream BSD license, and registers the algorithm in both library and scanner defaults. It also updates the JSON schema and documentation, with coverage for upstream interoperability, malformed public values, entropy failures, extensions, userauth collection, and classical compatibility.
How to Test
go test ./lib/ssh/... -count=1 -timeout=180s: passed.go test -race ./lib/ssh ./modules -run 'TestMLKEM|TestSSH|TestKexes' -count=1 -timeout=120s: passed.python3 -m zschema validate zgrab2 zgrab2_schemas/zgrab2/testdata/ssh-ssh.json --path . --module zgrab2_schemas.zgrab2: passed. Live verbose output from a PQ-only upstream Go SSH server was also validated against the updated schema.go vet ./lib/ssh ./modules: failed on pre-existingtestinggoroutinefindings in untouched SSH test files; no findings were reported in the new files.Notes & Caveats
The hybrid algorithm is offered after all existing classical algorithms, preserving their preference and avoiding larger hybrid exchanges when a classical alternative is available. It can be selected explicitly with
--kex-algorithms=mlkem768x25519-sha256.The scan log preserves the host key, signature, exchange hash, and hybrid server public value. Verbose output additionally includes the hybrid client public value.
This is a selective upstream port, not a full refresh or replacement of the SSH fork. It does not add
sntrup761x25519-sha512@openssh.com; support for ML-KEM is sufficient for the server configuration reported in the issue. No dependency or minimum Go version changes are needed.Issue Tracking
Fixes #796