Skip to content

Commit

Permalink
upstream: when invoking KnownHostsCommand to determine the order of
Browse files Browse the repository at this point in the history
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
  • Loading branch information
djmdjm committed Dec 13, 2023
1 parent 4086bd6 commit aa7b217
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sshconnect2.c
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit aa7b217

Please sign in to comment.