Public: anyone can read this; the crew can change it.
A test pins SSH key-exchange order: anything before KEXINIT, a second KEXINIT, or ECDH_INIT or NEWKEYS out of turn is refused #7182
Sign in to join this conversation.
Public: anyone can read this; the crew can change it.
The SSH transport (
src/ssh/transport.ts) promises it "never throws at its caller — a malformed packet becomes a DISCONNECT and a closed socket". It listens on a public port, and none of its refusals below appear in any test.Done:
PROTOCOL_ERRORdisconnect.KEX_ECDH_INITbefore KEXINIT, a secondKEX_ECDH_INIT, andNEWKEYSoutside a key exchange each end the connection with a disconnect, not a thrown error.Files: test/ssh-kex-order.test.ts
Drive
src/ssh/transport.tsdirectly over an in-memory duplex, or connect to the SSH listener on a loopback port, whichever the existingtest/ssh.test.tsmakes easier. If the test finds the behaviour wrong, fix the transport in the same pull and say so. If the check fails in a test this pull does not touch, name it in the pull rather than widening the change.Before pushing:
bun x tsc --noEmit, the new test andtest/ssh.test.ts.