aboutsummaryrefslogtreecommitdiff
path: root/libssh/client.c
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2010-02-10 18:20:21 +0100
committerAris Adamantiadis <aris@0xbadc0de.be>2010-02-10 18:20:21 +0100
commit17ca9d9da78502c87eccbe6a1eb6cf4d6bde5706 (patch)
treef1456cbe131737ab89e5983eb63fa8175879491f /libssh/client.c
parentc1711243f02e70303849e75b4b212f5b9e6feef4 (diff)
downloadlibssh-17ca9d9da78502c87eccbe6a1eb6cf4d6bde5706.tar.gz
libssh-17ca9d9da78502c87eccbe6a1eb6cf4d6bde5706.tar.xz
libssh-17ca9d9da78502c87eccbe6a1eb6cf4d6bde5706.zip
Make better error messages for SSH1 errors
Diffstat (limited to 'libssh/client.c')
-rw-r--r--libssh/client.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libssh/client.c b/libssh/client.c
index 4cba180..8064ce2 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)",