From 855b73de8745adfef145dba0b07ab37dcb83c142 Mon Sep 17 00:00:00 2001 From: milo Date: Tue, 10 Aug 2010 00:14:03 +0200 Subject: server: Split ssh_bind_accept and create ssh_handle_key_exchange. Signed-off-by: Andreas Schneider --- libssh/legacy.c | 4 +--- libssh/server.c | 9 ++++++++- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'libssh') diff --git a/libssh/legacy.c b/libssh/legacy.c index b2ecc0e6..83fb97a9 100644 --- a/libssh/legacy.c +++ b/libssh/legacy.c @@ -233,7 +233,5 @@ char *string_to_char(ssh_string str){ } int ssh_accept(ssh_session session) { - (void) session; - - return SSH_OK; + return ssh_handle_key_exchange(session); } diff --git a/libssh/server.c b/libssh/server.c index f0b6237d..f6ddf3dd 100644 --- a/libssh/server.c +++ b/libssh/server.c @@ -666,7 +666,7 @@ int ssh_bind_accept(ssh_bind sshbind, ssh_session session) { ssh_private_key dsa = NULL; ssh_private_key rsa = NULL; socket_t fd = SSH_INVALID_SOCKET; - int i, rc; + int i; if (sshbind->bindfd == SSH_INVALID_SOCKET) { ssh_set_error(sshbind, SSH_FATAL, @@ -747,6 +747,13 @@ int ssh_bind_accept(ssh_bind sshbind, ssh_session session) { session->dsa_key = dsa; session->rsa_key = rsa; +return SSH_OK; +} + +/* Do the banner and key exchange */ +int ssh_handle_key_exchange(ssh_session session) { + int rc; + rc = ssh_send_banner(session, 1); if (rc < 0) { return SSH_ERROR; -- cgit v1.2.3