Repository navigation
feat(ssh): name key exchange, cipher and MAC failures on the Mac - #3779
Merged
Merged
Conversation
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
LIBSSH2_ERROR_KEX_FAILUREthrowsSSHTunnelError.negotiationFailed, naming the stage (key exchange or host key, cipher, MAC), the server software and the methods TablePro supports, with a recovery suggestion. It used to betunnelCreationFailed("SSH handshake failed: Unable to exchange encryption keys").SSHTunnelErrortoSSHNegotiationFailure.explanationinTableProSSHTransport. The libssh2 half moves toTablePro/Core/SSH/LibSSH2Handshake.swift, shared with iOS by file reference; the iOSLibSSH2HandshakeFailuregoes.KEX_FAILUREwhen the server closes the connection or sends DISCONNECT before its KEXINIT. The handshake now watches libssh2's socket I/O and DISCONNECT callback and reports that as a closed connection, with the server's reason. Both apps had this.negotiationFailedand names the hop, on both apps. iOS used to fold it intojumpHostFailed, whose advice was to check the hop's address and key.jumpHostFailed(host:reason:), as on iOS. A channel a hop could not open keeps libssh2's reason. A cancelled sign-in stays a cancellation.ConnectionPreflightReporting, missing since feat: finish the follow-ups from the iOS feature PRs (#3680-#3690) #3697). New serverskex10(sntrup761x25519-sha512only) andcipher10(3des-cbconly), which libs-5's libssh2 lacks. New cells: cipher stage, key exchange failure on the first hop, on the server behind a hop and on the second of two hops, a missing key file. Both apps expect the named error.SSHTunnelFactoryTests.namedHopFailureNamesTheHopdrops its negotiation argument;hopNegotiationFailureKeepsItsCasecovers it.Needs the maintainer
ssh-rsa,ssh-dssand3des-cbcby default; 0.83.0-beta.1 (libs-2) offers them. A server limited to those now fails with this error. Turning them back on is a libssh2 rebuild and a libs publish.Test plan
LibSSH2NegotiationTests(new): a scripted server on a socket pair drivescreateSessionto each stage, a hang-up and a DISCONNECT after the banner, and a non-SSH banner.SSHTunnelErrorTests,SSHNegotiationFailureTests, iOSSSHTunnelFactoryTestsandSSHTunnelErrorClassifierTests.apple/scripts/probes/check-ssh-tunnel-matrix.shwith libs-5 against the pinned OpenSSH 10.3 and 9.9 containers: 186 of 186 cells (104 iOS, 82 macOS).Docs: TableProApp/docs#119 (draft, lands after this).
Fixes #3767