summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/ssh-keyscan.c
diff options
context:
space:
mode:
authordjm <djm@openbsd.org>2017-03-10 04:26:06 +0000
committerdjm <djm@openbsd.org>2017-03-10 04:26:06 +0000
commit288051c23dc3fc0a7bc3ac20da04869e7a887660 (patch)
tree12b612c5964ba514f649c0bc98a696927c61d85e /usr.bin/ssh/ssh-keyscan.c
parentmake hostname matching really insensitive to case; bz#2685, (diff)
downloadwireguard-openbsd-288051c23dc3fc0a7bc3ac20da04869e7a887660.tar.xz
wireguard-openbsd-288051c23dc3fc0a7bc3ac20da04869e7a887660.zip
ensure hostname is lower-case before hashing it; bz#2591 reported by
Griff Miller II; ok dtucker@
Diffstat (limited to 'usr.bin/ssh/ssh-keyscan.c')
-rw-r--r--usr.bin/ssh/ssh-keyscan.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/ssh/ssh-keyscan.c b/usr.bin/ssh/ssh-keyscan.c
index 9c300c1dfda..c8b5f186ac6 100644
--- a/usr.bin/ssh/ssh-keyscan.c
+++ b/usr.bin/ssh/ssh-keyscan.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-keyscan.c,v 1.108 2017/03/10 03:18:24 djm Exp $ */
+/* $OpenBSD: ssh-keyscan.c,v 1.109 2017/03/10 04:26:06 djm Exp $ */
/*
* Copyright 1995, 1996 by David Mazieres <dm@lcs.mit.edu>.
*
@@ -307,6 +307,7 @@ keyprint_one(const char *host, struct sshkey *key)
const char *known_host, *hashed;
hostport = put_host_port(host, ssh_port);
+ lowercase(hostport);
if (hash_hosts && (hashed = host_hash(host, NULL, 0)) == NULL)
fatal("host_hash failed");
known_host = hash_hosts ? hashed : hostport;