diff options
author | djm@openbsd.org <djm@openbsd.org> | 2017-03-10 04:26:06 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2017-03-10 15:35:39 +1100 |
commit | db2597207e69912f2592cd86a1de8e948a9d7ffb (patch) | |
tree | a21ec4fe01db6c7ccfcfdc52cacb9761a4693a52 /ssh-keygen.c | |
parent | df9936936c695f85c1038bd706d62edf752aca4b (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.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ssh-keygen.c b/ssh-keygen.c index 6fd1f0348..f17af036b 100644 --- a/ssh-keygen.c +++ b/ssh-keygen.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssh-keygen.c,v 1.298 2017/03/06 02:03:20 dtucker Exp $ */ | 1 | /* $OpenBSD: ssh-keygen.c,v 1.299 2017/03/10 04:26:06 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * 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) | |||
1108 | */ | 1108 | */ |
1109 | ohosts = hosts = xstrdup(l->hosts); | 1109 | ohosts = hosts = xstrdup(l->hosts); |
1110 | while ((cp = strsep(&hosts, ",")) != NULL && *cp != '\0') { | 1110 | while ((cp = strsep(&hosts, ",")) != NULL && *cp != '\0') { |
1111 | lowercase(cp); | ||
1111 | if ((hashed = host_hash(cp, NULL, 0)) == NULL) | 1112 | if ((hashed = host_hash(cp, NULL, 0)) == NULL) |
1112 | fatal("hash_host failed"); | 1113 | fatal("hash_host failed"); |
1113 | fprintf(ctx->out, "%s %s\n", hashed, l->rawkey); | 1114 | fprintf(ctx->out, "%s %s\n", hashed, l->rawkey); |