summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/ssh-keygen.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-keygen.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-keygen.c')
-rw-r--r--usr.bin/ssh/ssh-keygen.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/ssh/ssh-keygen.c b/usr.bin/ssh/ssh-keygen.c
index 6dc0925298e..8784e41c868 100644
--- a/usr.bin/ssh/ssh-keygen.c
+++ b/usr.bin/ssh/ssh-keygen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-keygen.c,v 1.298 2017/03/06 02:03:20 dtucker Exp $ */
+/* $OpenBSD: ssh-keygen.c,v 1.299 2017/03/10 04:26:06 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1092,6 +1092,7 @@ known_hosts_hash(struct hostkey_foreach_line *l, void *_ctx)
*/
ohosts = hosts = xstrdup(l->hosts);
while ((cp = strsep(&hosts, ",")) != NULL && *cp != '\0') {
+ lowercase(cp);
if ((hashed = host_hash(cp, NULL, 0)) == NULL)
fatal("hash_host failed");
fprintf(ctx->out, "%s %s\n", hashed, l->rawkey);