Use ssh_log instead of ssh_say in ssh_list_kex().
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@269 7dcaeef0-15fb-0310-b436-a5af3365683c
Этот коммит содержится в:
родитель
40bce93e97
Коммит
05495a263a
@ -558,7 +558,7 @@ socket_t ssh_connect_host(SSH_SESSION *session, const char *host,const char
|
|||||||
/* in kex.c */
|
/* in kex.c */
|
||||||
extern char *ssh_kex_nums[];
|
extern char *ssh_kex_nums[];
|
||||||
void ssh_send_kex(SSH_SESSION *session,int server_kex);
|
void ssh_send_kex(SSH_SESSION *session,int server_kex);
|
||||||
void ssh_list_kex(KEX *kex);
|
void ssh_list_kex(SSH_SESSION *session, KEX *kex);
|
||||||
int set_kex(SSH_SESSION *session);
|
int set_kex(SSH_SESSION *session);
|
||||||
int ssh_get_kex(SSH_SESSION *session, int server_kex);
|
int ssh_get_kex(SSH_SESSION *session, int server_kex);
|
||||||
int verify_existing_algo(int algo, const char *name);
|
int verify_existing_algo(int algo, const char *name);
|
||||||
|
@ -323,7 +323,7 @@ int ssh_connect(SSH_SESSION *session){
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
set_status(options,0.6);
|
set_status(options,0.6);
|
||||||
ssh_list_kex(&session->server_kex);
|
ssh_list_kex(session, &session->server_kex);
|
||||||
if(set_kex(session)){
|
if(set_kex(session)){
|
||||||
ssh_socket_close(session->socket);
|
ssh_socket_close(session->socket);
|
||||||
session->alive=0;
|
session->alive=0;
|
||||||
|
22
libssh/kex.c
22
libssh/kex.c
@ -137,14 +137,12 @@ char *ssh_find_matching(const char *in_d, const char *what_d){
|
|||||||
|
|
||||||
if( ! (in_d && what_d))
|
if( ! (in_d && what_d))
|
||||||
return NULL; /* don't deal with null args */
|
return NULL; /* don't deal with null args */
|
||||||
ssh_say(3,"find_matching(\"%s\",\"%s\") = ",in_d,what_d);
|
|
||||||
tok_in=tokenize(in_d);
|
tok_in=tokenize(in_d);
|
||||||
tok_what=tokenize(what_d);
|
tok_what=tokenize(what_d);
|
||||||
for(i_in=0; tok_in[i_in]; ++i_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){
|
||||||
if(!strcmp(tok_in[i_in],tok_what[i_what])){
|
if(!strcmp(tok_in[i_in],tok_what[i_what])){
|
||||||
/* match */
|
/* match */
|
||||||
ssh_say(3,"\"%s\"\n",tok_in[i_in]);
|
|
||||||
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]);
|
||||||
@ -155,7 +153,6 @@ char *ssh_find_matching(const char *in_d, const char *what_d){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ssh_say(3,"NULL\n");
|
|
||||||
free(tok_in[0]);
|
free(tok_in[0]);
|
||||||
free(tok_what[0]);
|
free(tok_what[0]);
|
||||||
free(tok_in);
|
free(tok_in);
|
||||||
@ -204,13 +201,16 @@ int ssh_get_kex(SSH_SESSION *session,int server_kex ){
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ssh_list_kex(KEX *kex){
|
void ssh_list_kex(struct ssh_session *session, KEX *kex) {
|
||||||
int i=0;
|
int i = 0;
|
||||||
|
|
||||||
#ifdef DEBUG_CRYPTO
|
#ifdef DEBUG_CRYPTO
|
||||||
ssh_print_hexa("session cookie",kex->cookie,16);
|
ssh_print_hexa("session cookie", kex->cookie, 16);
|
||||||
#endif
|
#endif
|
||||||
for(i=0;i<10;i++){
|
|
||||||
ssh_say(2,"%s : %s\n",ssh_kex_nums[i],kex->methods[i]);
|
for(i = 0; i < 10; i++) {
|
||||||
|
ssh_log(session, SSH_LOG_FUNCTIONS, "%s: %s",
|
||||||
|
ssh_kex_nums[i], kex->methods[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -259,7 +259,7 @@ void ssh_send_kex(SSH_SESSION *session, int server_kex){
|
|||||||
buffer_add_u8(session->out_buffer,SSH2_MSG_KEXINIT);
|
buffer_add_u8(session->out_buffer,SSH2_MSG_KEXINIT);
|
||||||
buffer_add_data(session->out_buffer,kex->cookie,16);
|
buffer_add_data(session->out_buffer,kex->cookie,16);
|
||||||
hashbufout_add_cookie(session);
|
hashbufout_add_cookie(session);
|
||||||
ssh_list_kex(kex);
|
ssh_list_kex(session, kex);
|
||||||
for(i=0;i<10;i++){
|
for(i=0;i<10;i++){
|
||||||
str=string_from_char(kex->methods[i]);
|
str=string_from_char(kex->methods[i]);
|
||||||
buffer_add_ssh_string(session->out_hashbuf,str);
|
buffer_add_ssh_string(session->out_hashbuf,str);
|
||||||
@ -368,7 +368,9 @@ static STRING *encrypt_session_key(SSH_SESSION *session, PUBLIC_KEY *svrkey,
|
|||||||
data1=string_new(32);
|
data1=string_new(32);
|
||||||
string_fill(data1,buffer,32);
|
string_fill(data1,buffer,32);
|
||||||
if(ABS(hlen-slen)<128){
|
if(ABS(hlen-slen)<128){
|
||||||
ssh_say(1,"Difference between server modulus and host modulus is only %d. It's illegal and may not work\n",
|
ssh_log(session, SSH_LOG_FUNCTIONS,
|
||||||
|
"Difference between server modulus and host modulus is only %d. "
|
||||||
|
"It's illegal and may not work",
|
||||||
ABS(hlen-slen));
|
ABS(hlen-slen));
|
||||||
}
|
}
|
||||||
if(modulus_smaller(svrkey,hostkey)){
|
if(modulus_smaller(svrkey,hostkey)){
|
||||||
|
@ -292,7 +292,7 @@ int ssh_accept(SSH_SESSION *session){
|
|||||||
ssh_send_kex(session,1);
|
ssh_send_kex(session,1);
|
||||||
if(ssh_get_kex(session,1))
|
if(ssh_get_kex(session,1))
|
||||||
return -1;
|
return -1;
|
||||||
ssh_list_kex(&session->client_kex);
|
ssh_list_kex(session, &session->client_kex);
|
||||||
crypt_set_algorithms_server(session);
|
crypt_set_algorithms_server(session);
|
||||||
if(dh_handshake_server(session))
|
if(dh_handshake_server(session))
|
||||||
return -1;
|
return -1;
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user