Commit e99871aa authored by Niels Möller's avatar Niels Möller
Browse files

* src/keyexchange.c (do_kexinit_filter): Don't crash if there are

no appropriate hostkeys.

Rev: src/keyexchange.c:1.75
parent e0d0b6d5
...@@ -475,7 +475,7 @@ kex_make_encrypt(struct hash_instance *secret, ...@@ -475,7 +475,7 @@ kex_make_encrypt(struct hash_instance *secret,
return NULL; return NULL;
key = kex_make_key(secret, algorithm->key_size, key = kex_make_key(secret, algorithm->key_size,
type, session_id); type, session_id);
if (algorithm->iv_size) if (algorithm->iv_size)
iv = kex_make_key(secret, algorithm->iv_size, iv = kex_make_key(secret, algorithm->iv_size,
...@@ -723,11 +723,14 @@ do_kexinit_filter(struct command *s, ...@@ -723,11 +723,14 @@ do_kexinit_filter(struct command *s,
self->init->hostkey_algorithms self->init->hostkey_algorithms
= filter_algorithms(keys, self->init->hostkey_algorithms); = filter_algorithms(keys, self->init->hostkey_algorithms);
if (!LIST_LENGTH(self->init->hostkey_algorithms)) if (!self->init->hostkey_algorithms)
{ {
werror("No hostkey algorithms advertised.\n"); werror("No hostkey algorithms advertised.\n");
self->init->hostkey_algorithms = make_int_list(1, ATOM_NONE, -1); self->init->hostkey_algorithms = make_int_list(1, ATOM_NONE, -1);
} }
assert(LIST_LENGTH(self->init->hostkey_algorithms));
COMMAND_RETURN(c, self->init); COMMAND_RETURN(c, self->init);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment