1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-08-07 08:02:55 +03:00

src: Remove enter_function() and leave_function().

This commit is contained in:
Andreas Schneider
2013-07-14 13:31:24 +02:00
parent 0d3deeec10
commit c64ec43eef
22 changed files with 267 additions and 494 deletions

View File

@@ -272,7 +272,6 @@ SSH_PACKET_CALLBACK(ssh_packet_kexinit){
char *strings[KEX_METHODS_SIZE];
int i;
enter_function();
(void)type;
(void)user;
memset(strings, 0, sizeof(strings));
@@ -335,7 +334,6 @@ SSH_PACKET_CALLBACK(ssh_packet_kexinit){
}
}
leave_function();
session->session_state=SSH_SESSION_STATE_KEXINIT_RECEIVED;
session->dh_handshake_state=DH_STATE_INIT;
session->ssh_connection_callback(session);
@@ -347,7 +345,7 @@ error:
}
session->session_state = SSH_SESSION_STATE_ERROR;
leave_function();
return SSH_PACKET_USED;
}
@@ -395,17 +393,14 @@ int set_client_kex(ssh_session session){
int ssh_kex_select_methods (ssh_session session){
struct ssh_kex_struct *server = &session->next_crypto->server_kex;
struct ssh_kex_struct *client = &session->next_crypto->client_kex;
int rc = SSH_ERROR;
int i;
enter_function();
for (i = 0; i < KEX_METHODS_SIZE; i++) {
session->next_crypto->kex_methods[i]=ssh_find_matching(server->methods[i],client->methods[i]);
if(session->next_crypto->kex_methods[i] == NULL && i < SSH_LANG_C_S){
ssh_set_error(session,SSH_FATAL,"kex error : no match for method %s: server [%s], client [%s]",
ssh_kex_descriptions[i],server->methods[i],client->methods[i]);
goto error;
return SSH_ERROR;
} else if ((i >= SSH_LANG_C_S) && (session->next_crypto->kex_methods[i] == NULL)) {
/* we can safely do that for languages */
session->next_crypto->kex_methods[i] = strdup("");
@@ -418,10 +413,8 @@ int ssh_kex_select_methods (ssh_session session){
} else if(strcmp(session->next_crypto->kex_methods[SSH_KEX], "ecdh-sha2-nistp256") == 0){
session->next_crypto->kex_type=SSH_KEX_ECDH_SHA2_NISTP256;
}
rc = SSH_OK;
error:
leave_function();
return rc;
return SSH_OK;
}
@@ -432,8 +425,6 @@ int ssh_send_kex(ssh_session session, int server_kex) {
ssh_string str = NULL;
int i;
enter_function();
if (buffer_add_u8(session->out_buffer, SSH2_MSG_KEXINIT) < 0) {
goto error;
}
@@ -471,18 +462,15 @@ int ssh_send_kex(ssh_session session, int server_kex) {
}
if (packet_send(session) == SSH_ERROR) {
leave_function();
return -1;
}
leave_function();
return 0;
error:
buffer_reinit(session->out_buffer);
buffer_reinit(session->out_hashbuf);
ssh_string_free(str);
leave_function();
return -1;
}