1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-12-02 01:17:52 +03:00

KEX bug: client preference should be prioritary

This commit is contained in:
Aris Adamantiadis
2010-02-09 21:20:17 +01:00
parent 512fa6e601
commit 96465a52ee

View File

@@ -53,7 +53,7 @@
#define BLOWFISH "" #define BLOWFISH ""
#endif #endif
#ifdef HAVE_OPENSSL_AES_H #ifdef HAVE_OPENSSL_AES_H
#define AES "aes256-cbc,aes192-cbc,aes128-cbc," #define AES "aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,"
#else #else
#define AES "" #define AES ""
#endif #endif
@@ -68,7 +68,7 @@
const char *default_methods[] = { const char *default_methods[] = {
"diffie-hellman-group1-sha1", "diffie-hellman-group1-sha1",
"ssh-dss,ssh-rsa", "ssh-rsa,ssh-dss",
AES BLOWFISH DES, AES BLOWFISH DES,
AES BLOWFISH DES, AES BLOWFISH DES,
"hmac-sha1", "hmac-sha1",
@@ -82,7 +82,7 @@ const char *default_methods[] = {
const char *supported_methods[] = { const char *supported_methods[] = {
"diffie-hellman-group1-sha1", "diffie-hellman-group1-sha1",
"ssh-dss,ssh-rsa", "ssh-rsa,ssh-dss",
AES BLOWFISH DES, AES BLOWFISH DES,
AES BLOWFISH DES, AES BLOWFISH DES,
"hmac-sha1", "hmac-sha1",
@@ -219,19 +219,19 @@ char *ssh_find_matching(const char *in_d, const char *what_d){
SAFE_FREE(tok_in); SAFE_FREE(tok_in);
} }
for(i_in=0; tok_in[i_in]; ++i_in){ for(i_what=0; tok_what[i_what] ; ++i_what){
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])){ if(!strcmp(tok_in[i_in],tok_what[i_what])){
/* match */ /* match */
ret=strdup(tok_in[i_in]); ret=strdup(tok_in[i_in]);
/* free the tokens */ /* free the tokens */
free(tok_in[0]); free(tok_in[0]);
free(tok_what[0]); free(tok_what[0]);
free(tok_in); free(tok_in);
free(tok_what); free(tok_what);
return ret; return ret;
}
} }
}
} }
free(tok_in[0]); free(tok_in[0]);
free(tok_what[0]); free(tok_what[0]);