=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/sshconnect2.c,v retrieving revision 1.327 retrieving revision 1.328 diff -u -r1.327 -r1.328 --- src/usr.bin/ssh/sshconnect2.c 2020/10/03 08:11:28 1.327 +++ src/usr.bin/ssh/sshconnect2.c 2020/10/04 09:45:01 1.328 @@ -1,4 +1,4 @@ -/* $OpenBSD: sshconnect2.c,v 1.327 2020/10/03 08:11:28 djm Exp $ */ +/* $OpenBSD: sshconnect2.c,v 1.328 2020/10/04 09:45:01 djm Exp $ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. * Copyright (c) 2008 Damien Miller. All rights reserved. @@ -141,7 +141,8 @@ */ best = first_alg(options.hostkeyalgorithms); if (lookup_key_in_hostkeys_by_type(hostkeys, - sshkey_type_plain(sshkey_type_from_name(best)), NULL)) { + sshkey_type_plain(sshkey_type_from_name(best)), + sshkey_ecdsa_nid_from_name(best), NULL)) { debug3("%s: have matching best-preference key type %s, " "using HostkeyAlgorithms verbatim", __func__, best); ret = xstrdup(options.hostkeyalgorithms); @@ -179,7 +180,8 @@ } /* If the key appears in known_hosts then prefer it */ if (lookup_key_in_hostkeys_by_type(hostkeys, - sshkey_type_plain(ktype), NULL)) { + sshkey_type_plain(ktype), + sshkey_ecdsa_nid_from_name(alg), NULL)) { ALG_APPEND(first, alg); continue; }