orlandos-nl / Citadel

SSH Client & Server framework in Swift
MIT License
236 stars 41 forks source link

Failed precodition when connecting to ssh server with algorithms .all #76

Open depth42 opened 3 weeks ago

depth42 commented 3 weeks ago

Describe the bug When connecting to a certain ssh server, Citadel crashes with a failed precondition.

Reproducer Sample

func test() async throws { let client = try await SSHClient.connect( host: "vwp5409.webpack.hosteurope.de", authenticationMethod: .passwordBased(username: "abc", password: "abc"), hostKeyValidator: .acceptAnything(), reconnect: .never, algorithms: .all ) try await client.close() }

Expected behavior The connection attempt should throw an error because of wrong user credentials.

Actual behavior The app terminates with a failed precondition in NIOCore.ByteBuffer-code:1066 "NIO-ELT-0-#0 (9): Precondition failed: new writerIndex: 2051, expected: range(0, 2048)"

Client (please complete the following information):

Server (please complete the following information):

SFTPClient.zip

Joannis commented 2 weeks ago

Thanks for the report, and the repro!