diff options
author | Aris Adamantiadis <aris@0xbadc0de.be> | 2009-10-29 10:36:00 +0100 |
---|---|---|
committer | Aris Adamantiadis <aris@0xbadc0de.be> | 2009-10-29 10:36:00 +0100 |
commit | 17f2645a32e6524c36b2f83831080eda378c12bf (patch) | |
tree | c562984b687ad75baa658761811ab76bcb922910 /libssh/server.c | |
parent | 9f034aca9c848106d4fc03da9ca6ec140565413f (diff) | |
download | libssh-17f2645a32e6524c36b2f83831080eda378c12bf.tar.gz libssh-17f2645a32e6524c36b2f83831080eda378c12bf.tar.xz libssh-17f2645a32e6524c36b2f83831080eda378c12bf.zip |
Fix server kex again
Diffstat (limited to 'libssh/server.c')
-rw-r--r-- | libssh/server.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libssh/server.c b/libssh/server.c index 0abb9fc5..9de032f2 100644 --- a/libssh/server.c +++ b/libssh/server.c @@ -197,7 +197,7 @@ int ssh_bind_accept(ssh_bind sshbind, ssh_session session) { ssh_set_error(sshbind, SSH_FATAL,"session is null"); return SSH_ERROR; } - if (sshbind->dsakey == NULL || sshbind->rsakey == NULL) { + if (sshbind->dsakey == NULL && sshbind->rsakey == NULL) { ssh_set_error(sshbind, SSH_FATAL, "DSA or RSA host key file must be set before accept()"); return SSH_ERROR; @@ -315,16 +315,16 @@ static int server_set_kex(ssh_session session) { ZERO_STRUCTP(server); ssh_get_random(server->cookie, 16, 0); if (session->dsa_key != NULL && session->rsa_key != NULL) { - if (ssh_options_set(session, SSH_BIND_OPTIONS_HOSTKEY, + if (ssh_options_set_algo(session, SSH_HOSTKEYS, "ssh-dss,ssh-rsa") < 0) { return -1; } } else if (session->dsa_key != NULL) { - if (ssh_options_set(session, SSH_BIND_OPTIONS_HOSTKEY, "ssh-dss") < 0) { + if (ssh_options_set_algo(session, SSH_HOSTKEYS, "ssh-dss") < 0) { return -1; } } else { - if (ssh_options_set(session, SSH_BIND_OPTIONS_HOSTKEY, "ssh-rsa") < 0) { + if (ssh_options_set_algo(session, SSH_HOSTKEYS, "ssh-rsa") < 0) { return -1; } } |