aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2023-12-13 03:28:19 +0000
committerDamien Miller <djm@mindrot.org>2023-12-13 14:33:50 +1100
commitaa7b21708511a6d4aed3839fc9f6e82e849dd4a1 (patch)
treeb716a456c5091a1ef7b9ce547fd984ea4c8c8326
parent4086bd6652c0badccc020218a62190a7798fb72c (diff)
downloadopenssh-aa7b21708511a6d4aed3839fc9f6e82e849dd4a1.tar.gz
upstream: when invoking KnownHostsCommand to determine the order of
host key algorithms to request, ensure that the hostname passed to the command is decorated with the port number for ports other than 22. This matches the behaviour of KnownHostsCommand when invoked to look up the actual host key. bz3643, ok dtucker@ OpenBSD-Commit-ID: 5cfabc0b7c6c7ab473666df314f377b1f15420b1
-rw-r--r--sshconnect2.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sshconnect2.c b/sshconnect2.c
index 5831a00c6..df6caf817 100644
--- a/sshconnect2.c
+++ b/sshconnect2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshconnect2.c,v 1.368 2023/10/12 02:15:53 djm Exp $ */
+/* $OpenBSD: sshconnect2.c,v 1.369 2023/12/13 03:28:19 djm Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
* Copyright (c) 2008 Damien Miller. All rights reserved.
@@ -140,7 +140,7 @@ order_hostkeyalgs(char *host, struct sockaddr *hostaddr, u_short port,
}
if (options.known_hosts_command != NULL) {
load_hostkeys_command(hostkeys, options.known_hosts_command,
- "ORDER", cinfo, NULL, host);
+ "ORDER", cinfo, NULL, hostname);
}
/*
* If a plain public key exists that matches the type of the best