1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-12-02 01:17:52 +03:00

Fix server kex

This commit is contained in:
Aris Adamantiadis
2009-10-29 10:02:49 +01:00
parent 22bdfa3886
commit 9f034aca9c

View File

@@ -305,7 +305,6 @@ extern char *supported_methods[];
* -What is available (keys) * -What is available (keys)
* It should then accept the intersection of what the user asked * It should then accept the intersection of what the user asked
* and what is available, and return an error if nothing matches * and what is available, and return an error if nothing matches
* @bug To rewrite, it's broken !!
*/ */
static int server_set_kex(ssh_session session) { static int server_set_kex(ssh_session session) {
@@ -315,22 +314,20 @@ static int server_set_kex(ssh_session session) {
ZERO_STRUCTP(server); ZERO_STRUCTP(server);
ssh_get_random(server->cookie, 16, 0); ssh_get_random(server->cookie, 16, 0);
#if 0
if (session->dsa_key != NULL && session->rsa_key != NULL) { if (session->dsa_key != NULL && session->rsa_key != NULL) {
if (ssh_bind_options_set(options, SSH_BIND_OPTIONS_HOSTKEY, if (ssh_options_set(session, SSH_BIND_OPTIONS_HOSTKEY,
"ssh-dss,ssh-rsa") < 0) { "ssh-dss,ssh-rsa") < 0) {
return -1; return -1;
} }
} else if (session->dsa_key != NULL) { } else if (session->dsa_key != NULL) {
if (ssh_bind_options_set(options, SSH_BIND_OPTIONS_HOSTKEY, "ssh-dss") < 0) { if (ssh_options_set(session, SSH_BIND_OPTIONS_HOSTKEY, "ssh-dss") < 0) {
return -1; return -1;
} }
} else { } else {
if (ssh_bind_options_set(options, SSH_BIND_OPTIONS_HOSTKEY, "ssh-rsa") < 0) { if (ssh_options_set(session, SSH_BIND_OPTIONS_HOSTKEY, "ssh-rsa") < 0) {
return -1; return -1;
} }
} }
#endif
server->methods = malloc(10 * sizeof(char **)); server->methods = malloc(10 * sizeof(char **));
if (server->methods == NULL) { if (server->methods == NULL) {