From d896d6393b94afa068775ab34dc6d8ba3b46e177 Mon Sep 17 00:00:00 2001 From: milo Date: Sun, 8 Aug 2010 23:02:48 +0200 Subject: wrapper: Added a log message if client kex is empty. Signed-off-by: Andreas Schneider --- libssh/wrapper.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'libssh') diff --git a/libssh/wrapper.c b/libssh/wrapper.c index ae60b2e..a78a93d 100644 --- a/libssh/wrapper.c +++ b/libssh/wrapper.c @@ -223,10 +223,15 @@ int crypt_set_algorithms_server(ssh_session session){ enter_function(); /* out */ server = session->server_kex.methods[SSH_CRYPT_S_C]; - client = session->client_kex.methods[SSH_CRYPT_S_C]; + if(session && session->client_kex.methods) { + client = session->client_kex.methods[SSH_CRYPT_S_C]; + } else { + ssh_log(session,SSH_LOG_PROTOCOL, "Client KEX empty"); + } /* That's the client algorithms that are more important */ match = ssh_find_matching(server,client); + if(!match){ ssh_set_error(session,SSH_FATAL,"Crypt_set_algorithms_server : no matching algorithm function found for %s",server); free(match); -- cgit v1.2.3