diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2013-07-14 13:31:24 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2013-07-14 13:31:24 +0200 |
commit | c64ec43eef8ec5a8b8a8f4c4c3216043aea8e08a (patch) | |
tree | 33131e402f35d800cf923f837ae4c72166703b27 /src/kex.c | |
parent | 0d3deeec101b0d6568d7c04eda833bde47c7329c (diff) | |
download | libssh-c64ec43eef8ec5a8b8a8f4c4c3216043aea8e08a.tar.gz libssh-c64ec43eef8ec5a8b8a8f4c4c3216043aea8e08a.tar.xz libssh-c64ec43eef8ec5a8b8a8f4c4c3216043aea8e08a.zip |
src: Remove enter_function() and leave_function().
Diffstat (limited to 'src/kex.c')
-rw-r--r-- | src/kex.c | 20 |
1 files changed, 4 insertions, 16 deletions
@@ -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; } |