diff options
author | djm@openbsd.org <djm@openbsd.org> | 2020-10-04 11:45:01 +0200 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2020-10-07 04:33:12 +0200 |
commit | af889a40ffc113af9105c03d7b32131eb4372d50 (patch) | |
tree | 3acd6d5a99708fc7fc07740c67c862498b8fa078 /sshconnect2.c | |
parent | upstream: Allow full range of UIDs and GIDs for sftp chown and (diff) | |
download | openssh-af889a40ffc113af9105c03d7b32131eb4372d50.tar.xz openssh-af889a40ffc113af9105c03d7b32131eb4372d50.zip |
upstream: when ordering host key algorithms in the client, consider
the ECDSA key subtype; ok markus@
OpenBSD-Commit-ID: 3097686f853c61ff61772ea35f8b699931392ece
Diffstat (limited to 'sshconnect2.c')
-rw-r--r-- | sshconnect2.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sshconnect2.c b/sshconnect2.c index 44d7e6822..ec539afb3 100644 --- a/sshconnect2.c +++ b/sshconnect2.c @@ -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. @@ -146,7 +146,8 @@ order_hostkeyalgs(char *host, struct sockaddr *hostaddr, u_short port) */ 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); @@ -184,7 +185,8 @@ order_hostkeyalgs(char *host, struct sockaddr *hostaddr, u_short port) } /* 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; } |