aboutsummaryrefslogtreecommitdiff
path: root/libssh
diff options
context:
space:
mode:
authormilo <milo@r0ot.me>2010-08-10 00:14:03 +0200
committerAndreas Schneider <asn@cynapses.org>2010-08-10 00:30:25 +0200
commit855b73de8745adfef145dba0b07ab37dcb83c142 (patch)
tree866f428455b401c6f143864765e77f43e8cad9e7 /libssh
parent136f4d3b0d7475ae212dcf824c3ff624a97a08ad (diff)
downloadlibssh-855b73de8745adfef145dba0b07ab37dcb83c142.tar.gz
libssh-855b73de8745adfef145dba0b07ab37dcb83c142.tar.xz
libssh-855b73de8745adfef145dba0b07ab37dcb83c142.zip
server: Split ssh_bind_accept and create ssh_handle_key_exchange.
Signed-off-by: Andreas Schneider <asn@cynapses.org>
Diffstat (limited to 'libssh')
-rw-r--r--libssh/legacy.c4
-rw-r--r--libssh/server.c9
2 files changed, 9 insertions, 4 deletions
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;