aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormilo <milo@r0ot.me>2010-08-08 23:02:48 +0200
committerAndreas Schneider <asn@cynapses.org>2010-08-09 20:54:17 +0200
commitd896d6393b94afa068775ab34dc6d8ba3b46e177 (patch)
treeeb83f68c54480c819531acf5ccaf90c9c5586776
parent6d531ed0a68178d7dd6f3ed91e08bbe8b03fb6f0 (diff)
downloadlibssh-d896d6393b94afa068775ab34dc6d8ba3b46e177.tar.gz
libssh-d896d6393b94afa068775ab34dc6d8ba3b46e177.tar.xz
libssh-d896d6393b94afa068775ab34dc6d8ba3b46e177.zip
wrapper: Added a log message if client kex is empty.
Signed-off-by: Andreas Schneider <asn@cynapses.org>
-rw-r--r--libssh/wrapper.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libssh/wrapper.c b/libssh/wrapper.c
index ae60b2e6..a78a93d9 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);