From 30624c5366ffbb342f219a9fa985ffc0bc72c48e Mon Sep 17 00:00:00 2001 From: olegkap_cp Date: Thu, 5 May 2011 15:08:35 +0000 Subject: [PATCH] Handle SSH_MSG_USERAUTH_BANNER prior establishing secure connection --- Renci.SshClient/Renci.SshClient/Session.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Renci.SshClient/Renci.SshClient/Session.cs b/Renci.SshClient/Renci.SshClient/Session.cs index c21b1b84..fb0a5bf9 100644 --- a/Renci.SshClient/Renci.SshClient/Session.cs +++ b/Renci.SshClient/Renci.SshClient/Session.cs @@ -485,6 +485,8 @@ namespace Renci.SshClient this.RegisterMessage("SSH_MSG_KEXINIT"); this.RegisterMessage("SSH_MSG_NEWKEYS"); + // Some server implementations might sent this message first, prior establishing encryption algorithm + this.RegisterMessage("SSH_MSG_USERAUTH_BANNER"); // Start incoming request listener this._messageListener = Task.Factory.StartNew(() => { this.MessageListener(); }, TaskCreationOptions.LongRunning);