summaryrefslogtreecommitdiffstats
path: root/ssh-keygen.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-keygen.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-keygen.c')
-rw-r--r--ssh-keygen.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ssh-keygen.c b/ssh-keygen.c
index 6fd1f034..f17af036 100644
--- a/ssh-keygen.c
+++ b/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
@@ -1108,6 +1108,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);