From 893b69d82b4435973ec4d15aaecdf352f5f827e2 Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Thu, 18 Oct 2018 13:46:52 +0200 Subject: 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 --- src/knownhosts.c | 4 +--- 1 file changed, 1 insertion(+), 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) { -- cgit v1.2.3