[openssh-commits] [openssh] 03/05: upstream commit

git+noreply at mindrot.org git+noreply at mindrot.org
Fri Mar 10 15:25:53 AEDT 2017


This is an automated email from the git hooks/post-receive script.

dtucker pushed a commit to branch master
in repository openssh.

commit 8a2834454c73dfc1eb96453c0e97690595f3f4c2
Author: djm at openbsd.org <djm at openbsd.org>
Date:   Fri Mar 10 03:18:24 2017 +0000

    upstream commit
    
    correctly hash hosts with a port number. Reported by Josh
    Powers in bz#2692; ok dtucker@
    
    Upstream-ID: 468e357ff143e00acc05bdd2803a696b3d4b6442
---
 ssh-keyscan.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/ssh-keyscan.c b/ssh-keyscan.c
index eea8d0a..e34286e 100644
--- a/ssh-keyscan.c
+++ b/ssh-keyscan.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-keyscan.c,v 1.107 2017/01/06 03:41:58 djm Exp $ */
+/* $OpenBSD: ssh-keyscan.c,v 1.108 2017/03/10 03:18:24 djm Exp $ */
 /*
  * Copyright 1995, 1996 by David Mazieres <dm at lcs.mit.edu>.
  *
@@ -321,16 +321,17 @@ keygrab_ssh2(con *c)
 }
 
 static void
-keyprint_one(char *host, struct sshkey *key)
+keyprint_one(const char *host, struct sshkey *key)
 {
 	char *hostport;
-
-	if (hash_hosts && (host = host_hash(host, NULL, 0)) == NULL)
-		fatal("host_hash failed");
+	const char *known_host, *hashed;
 
 	hostport = put_host_port(host, ssh_port);
+	if (hash_hosts && (hashed = host_hash(host, NULL, 0)) == NULL)
+		fatal("host_hash failed");
+	known_host = hash_hosts ? hashed : hostport;
 	if (!get_cert)
-		fprintf(stdout, "%s ", hostport);
+		fprintf(stdout, "%s ", known_host);
 	sshkey_write(key, stdout);
 	fputs("\n", stdout);
 	free(hostport);

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list