[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 2/3] Import keys during ssh_bind_accept_fd
[Thread Prev] | [Thread Next]
- Subject: [PATCH v2 2/3] Import keys during ssh_bind_accept_fd
- From: Alan Dunn <amdunn@xxxxxxxxx>
- Reply-to: libssh@xxxxxxxxxx
- Date: Tue, 21 Jan 2014 08:19:31 -0600
- To: libssh@xxxxxxxxxx
- Cc: Alan Dunn <amdunn@xxxxxxxxx>
Signed-off-by: Alan Dunn <amdunn@xxxxxxxxx> --- src/bind.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/bind.c b/src/bind.c index e06cb7e..5234e5b 100644 --- a/src/bind.c +++ b/src/bind.c @@ -382,7 +382,7 @@ void ssh_bind_free(ssh_bind sshbind){ } int ssh_bind_accept_fd(ssh_bind sshbind, ssh_session session, socket_t fd){ - int i; + int i, rc; if (session == NULL){ ssh_set_error(sshbind, SSH_FATAL,"session is null"); @@ -424,6 +424,16 @@ int ssh_bind_accept_fd(ssh_bind sshbind, ssh_session session, socket_t fd){ ssh_socket_set_fd(session->socket, fd); ssh_socket_get_poll_handle_out(session->socket); + /* We must try to import any keys that could be imported in case + * we are not using ssh_bind_listen (which is the other place + * where keys can be imported) on this ssh_bind and are instead + * only using ssh_bind_accept_fd to manage sockets ourselves. + */ + rc = ssh_bind_import_keys(sshbind); + if (rc != SSH_OK) { + return SSH_ERROR; + } + #ifdef HAVE_ECC if (sshbind->ecdsa) { session->srv.ecdsa_key = ssh_key_dup(sshbind->ecdsa); -- 1.7.9.5
[PATCH v2 0/3] Allow use of ssh_bind_accept_fd without ssh_bind_listen | Alan Dunn <amdunn@xxxxxxxxx> |