From 17ca9d9da78502c87eccbe6a1eb6cf4d6bde5706 Mon Sep 17 00:00:00 2001 From: Aris Adamantiadis Date: Wed, 10 Feb 2010 18:20:21 +0100 Subject: [PATCH] Make better error messages for SSH1 errors --- libssh/client.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libssh/client.c b/libssh/client.c index 4cba1807..8064ce24 100644 --- a/libssh/client.c +++ b/libssh/client.c @@ -580,6 +580,16 @@ void ssh_connection_callback(ssh_session session){ session->version = 2; } else if(ssh1 && session->ssh1) { session->version = 1; + } else if(ssh1 && !session->ssh1){ +#ifdef WITH_SSH1 + ssh_set_error(session, SSH_FATAL, + "SSH-1 protocol not available (configure session to allow SSH-1)"); + goto error; +#else + ssh_set_error(session, SSH_FATAL, + "SSH-1 protocol not available (libssh compiled without SSH-1 support)"); + goto error; +#endif } else { ssh_set_error(session, SSH_FATAL, "No version of SSH protocol usable (banner: %s)",