aboutsummaryrefslogtreecommitdiff
path: root/libssh/wrapper.c
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2010-03-28 21:43:13 +0200
committerAris Adamantiadis <aris@0xbadc0de.be>2010-03-28 21:59:11 +0200
commit9da13d4ff8152d58bb3debe03ab241ec23ac00b4 (patch)
tree1c8a3ce30af05ef84aa966df3dcef3abe288fdfb /libssh/wrapper.c
parent7d49e49e74c4eed0c14e354efde832c39b2740f4 (diff)
downloadlibssh-9da13d4ff8152d58bb3debe03ab241ec23ac00b4.tar.gz
libssh-9da13d4ff8152d58bb3debe03ab241ec23ac00b4.tar.xz
libssh-9da13d4ff8152d58bb3debe03ab241ec23ac00b4.zip
Fixes the broken algorithm choice for server
Diffstat (limited to 'libssh/wrapper.c')
-rw-r--r--libssh/wrapper.c11
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"))