diff options
Diffstat (limited to 'libssh/wrapper.c')
-rw-r--r-- | libssh/wrapper.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/libssh/wrapper.c b/libssh/wrapper.c index a42c2367..807f743a 100644 --- a/libssh/wrapper.c +++ b/libssh/wrapper.c @@ -1001,7 +1001,8 @@ int crypt_set_algorithms_server(ssh_session session){ /* out */ server = session->server_kex.methods[SSH_CRYPT_S_C]; client = session->client_kex.methods[SSH_CRYPT_S_C]; - match = ssh_find_matching(client, server); + /* 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); @@ -1030,7 +1031,7 @@ int crypt_set_algorithms_server(ssh_session session){ /* in */ client=session->client_kex.methods[SSH_CRYPT_C_S]; server=session->server_kex.methods[SSH_CRYPT_S_C]; - match=ssh_find_matching(client,server); + 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); @@ -1058,7 +1059,7 @@ int crypt_set_algorithms_server(ssh_session session){ /* compression */ client=session->client_kex.methods[SSH_CRYPT_C_S]; server=session->server_kex.methods[SSH_CRYPT_C_S]; - match=ssh_find_matching(client,server); + match=ssh_find_matching(server,client); if(match && !strcmp(match,"zlib")){ ssh_log(session,SSH_LOG_PACKET,"enabling C->S compression"); session->next_crypto->do_compress_in=1; @@ -1067,7 +1068,7 @@ int crypt_set_algorithms_server(ssh_session session){ client=session->client_kex.methods[SSH_CRYPT_S_C]; server=session->server_kex.methods[SSH_CRYPT_S_C]; - match=ssh_find_matching(client,server); + match=ssh_find_matching(server,client); if(match && !strcmp(match,"zlib")){ ssh_log(session,SSH_LOG_PACKET,"enabling S->C compression\n"); session->next_crypto->do_compress_out=1; @@ -1076,7 +1077,7 @@ int crypt_set_algorithms_server(ssh_session session){ server=session->server_kex.methods[SSH_HOSTKEYS]; client=session->client_kex.methods[SSH_HOSTKEYS]; - match=ssh_find_matching(client,server); + match=ssh_find_matching(server,client); if(match && !strcmp(match,"ssh-dss")) session->hostkeys=TYPE_DSS; else if(match && !strcmp(match,"ssh-rsa")) |