diff options
authorJakub Jelen <>2018-10-18 13:46:52 +0200
committerAndreas Schneider <>2018-10-19 17:42:55 +0200
commit893b69d82b4435973ec4d15aaecdf352f5f827e2 (patch)
parent9285e8516bc234774c68aef10264abd9c175cf50 (diff)
knownhosts: Use the correct name for ECDSA keys for host key negotiation
The conversion from ssh_keytype_e to string does not work for ECDSA keys, because different key lengths have different string representation. The usage of type_c should work also for every other key type in future, but it does not reflrect different signature types (SHA2 extension for RSA keys), but this early in the key exchange phase, we can not make any assumptions about supported extensions by the server. Signed-off-by: Jakub Jelen <> Reviewed-by: Andreas Schneider <>
1 files changed, 1 insertions, 3 deletions
diff --git a/src/knownhosts.c b/src/knownhosts.c
index d7c32e1a..54a2f292 100644
--- a/src/knownhosts.c
+++ b/src/knownhosts.c
@@ -340,12 +340,10 @@ struct ssh_list *ssh_known_hosts_get_algorithms(ssh_session session)
it != NULL;
it = ssh_list_get_iterator(entry_list)) {
struct ssh_knownhosts_entry *entry = NULL;
- enum ssh_keytypes_e key_type;
const char *algo = NULL;
entry = ssh_iterator_value(struct ssh_knownhosts_entry *, it);
- key_type = ssh_key_type(entry->publickey);
- algo = ssh_key_type_to_char(key_type);
+ algo = entry->publickey->type_c;
rc = ssh_list_append(list, algo);
if (rc != SSH_OK) {