aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2010-02-09 21:20:17 +0100
committerAris Adamantiadis <aris@0xbadc0de.be>2010-02-09 22:42:53 +0100
commita700259b01c5a31fc510db6013e1c66ffd6e1021 (patch)
tree0749a8510cc9b30305666a97a0fcbb453a7e98ff
parent14da14db05f627b867076073654df5d2f6436614 (diff)
downloadlibssh-a700259b01c5a31fc510db6013e1c66ffd6e1021.tar.gz
libssh-a700259b01c5a31fc510db6013e1c66ffd6e1021.tar.xz
libssh-a700259b01c5a31fc510db6013e1c66ffd6e1021.zip
KEX bug: client preference should be prioritary
-rw-r--r--libssh/kex.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/libssh/kex.c b/libssh/kex.c
index 8823fbc4..135e1bbc 100644
--- a/libssh/kex.c
+++ b/libssh/kex.c
@@ -52,7 +52,7 @@
#define BLOWFISH ""
#endif
#ifdef HAVE_OPENSSL_AES_H
-#define AES "aes256-cbc,aes192-cbc,aes128-cbc,"
+#define AES "aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,"
#else
#define AES ""
#endif
@@ -67,7 +67,7 @@
const char *default_methods[] = {
"diffie-hellman-group1-sha1",
- "ssh-dss,ssh-rsa",
+ "ssh-rsa,ssh-dss",
AES BLOWFISH DES,
AES BLOWFISH DES,
"hmac-sha1",
@@ -81,7 +81,7 @@ const char *default_methods[] = {
const char *supported_methods[] = {
"diffie-hellman-group1-sha1",
- "ssh-dss,ssh-rsa",
+ "ssh-rsa,ssh-dss",
AES BLOWFISH DES,
AES BLOWFISH DES,
"hmac-sha1",
@@ -218,19 +218,19 @@ char *ssh_find_matching(const char *in_d, const char *what_d){
SAFE_FREE(tok_in);
}
- for(i_in=0; tok_in[i_in]; ++i_in){
- for(i_what=0; tok_what[i_what] ; ++i_what){
- if(!strcmp(tok_in[i_in],tok_what[i_what])){
- /* match */
- ret=strdup(tok_in[i_in]);
- /* free the tokens */
- free(tok_in[0]);
- free(tok_what[0]);
- free(tok_in);
- free(tok_what);
- return ret;
- }
+ for(i_what=0; tok_what[i_what] ; ++i_what){
+ for(i_in=0; tok_in[i_in]; ++i_in){
+ if(!strcmp(tok_in[i_in],tok_what[i_what])){
+ /* match */
+ ret=strdup(tok_in[i_in]);
+ /* free the tokens */
+ free(tok_in[0]);
+ free(tok_what[0]);
+ free(tok_in);
+ free(tok_what);
+ return ret;
}
+ }
}
free(tok_in[0]);
free(tok_what[0]);