summaryrefslogtreecommitdiff
path: root/ssh-keyscan.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2017-03-10 04:26:06 +0000
committerDamien Miller <djm@mindrot.org>2017-03-10 15:35:39 +1100
commitdb2597207e69912f2592cd86a1de8e948a9d7ffb (patch)
treea21ec4fe01db6c7ccfcfdc52cacb9761a4693a52 /ssh-keyscan.c
parentdf9936936c695f85c1038bd706d62edf752aca4b (diff)
upstream commit
ensure hostname is lower-case before hashing it; bz#2591 reported by Griff Miller II; ok dtucker@ Upstream-ID: c3b8b93804f376bd00d859b8bcd9fc0d86b4db17
Diffstat (limited to 'ssh-keyscan.c')
-rw-r--r--ssh-keyscan.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ssh-keyscan.c b/ssh-keyscan.c
index e34286e47..1f95239a3 100644
--- a/ssh-keyscan.c
+++ b/ssh-keyscan.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh-keyscan.c,v 1.108 2017/03/10 03:18:24 djm Exp $ */ 1/* $OpenBSD: ssh-keyscan.c,v 1.109 2017/03/10 04:26:06 djm Exp $ */
2/* 2/*
3 * Copyright 1995, 1996 by David Mazieres <dm@lcs.mit.edu>. 3 * Copyright 1995, 1996 by David Mazieres <dm@lcs.mit.edu>.
4 * 4 *
@@ -327,6 +327,7 @@ keyprint_one(const char *host, struct sshkey *key)
327 const char *known_host, *hashed; 327 const char *known_host, *hashed;
328 328
329 hostport = put_host_port(host, ssh_port); 329 hostport = put_host_port(host, ssh_port);
330 lowercase(hostport);
330 if (hash_hosts && (hashed = host_hash(host, NULL, 0)) == NULL) 331 if (hash_hosts && (hashed = host_hash(host, NULL, 0)) == NULL)
331 fatal("host_hash failed"); 332 fatal("host_hash failed");
332 known_host = hash_hosts ? hashed : hostport; 333 known_host = hash_hosts ? hashed : hostport;