diff options
author | Damien Miller <djm@mindrot.org> | 2008-02-10 22:24:30 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2008-02-10 22:24:30 +1100 |
commit | a8796f3fcc8584ad01ba0132a0ae1d7d1131febd (patch) | |
tree | e6b9a74ef6d1c217d8b4d76b34eec6ea3a40a065 | |
parent | 6b0c818568b2650f519ee2dc9c685c313d802c1c (diff) |
- djm@cvs.openbsd.org 2008/01/19 22:22:58
[ssh-keygen.c]
when hashing individual hosts (ssh-keygen -Hf hostname), make sure we
hash just the specified hostname and not the entire hostspec from the
keyfile. It may be of the form "hostname,ipaddr", which would lead to
a hash that never matches. report and fix from jp AT devnull.cz
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | ssh-keygen.c | 7 |
2 files changed, 11 insertions, 4 deletions
@@ -23,6 +23,12 @@ | |||
23 | [sftp-client.c] | 23 | [sftp-client.c] |
24 | fix remote handle leak in do_download() local file open error path; | 24 | fix remote handle leak in do_download() local file open error path; |
25 | report and fix from sworley AT chkno.net | 25 | report and fix from sworley AT chkno.net |
26 | - djm@cvs.openbsd.org 2008/01/19 22:22:58 | ||
27 | [ssh-keygen.c] | ||
28 | when hashing individual hosts (ssh-keygen -Hf hostname), make sure we | ||
29 | hash just the specified hostname and not the entire hostspec from the | ||
30 | keyfile. It may be of the form "hostname,ipaddr", which would lead to | ||
31 | a hash that never matches. report and fix from jp AT devnull.cz | ||
26 | 32 | ||
27 | 20080119 | 33 | 20080119 |
28 | - (djm) Silence noice from expr in ssh-copy-id; patch from | 34 | - (djm) Silence noice from expr in ssh-copy-id; patch from |
@@ -3551,4 +3557,4 @@ | |||
3551 | OpenServer 6 and add osr5bigcrypt support so when someone migrates | 3557 | OpenServer 6 and add osr5bigcrypt support so when someone migrates |
3552 | passwords between UnixWare and OpenServer they will still work. OK dtucker@ | 3558 | passwords between UnixWare and OpenServer they will still work. OK dtucker@ |
3553 | 3559 | ||
3554 | $Id: ChangeLog,v 1.4824 2008/02/10 11:23:41 djm Exp $ | 3560 | $Id: ChangeLog,v 1.4825 2008/02/10 11:24:30 djm Exp $ |
diff --git a/ssh-keygen.c b/ssh-keygen.c index 657937629..6a2c52017 100644 --- a/ssh-keygen.c +++ b/ssh-keygen.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssh-keygen.c,v 1.163 2007/10/02 17:49:58 chl Exp $ */ | 1 | /* $OpenBSD: ssh-keygen.c,v 1.164 2008/01/19 22:22:58 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 |
@@ -596,7 +596,7 @@ do_fingerprint(struct passwd *pw) | |||
596 | } | 596 | } |
597 | 597 | ||
598 | static void | 598 | static void |
599 | print_host(FILE *f, char *name, Key *public, int hash) | 599 | print_host(FILE *f, const char *name, Key *public, int hash) |
600 | { | 600 | { |
601 | if (hash && (name = host_hash(name, NULL, 0)) == NULL) | 601 | if (hash && (name = host_hash(name, NULL, 0)) == NULL) |
602 | fatal("hash_host failed"); | 602 | fatal("hash_host failed"); |
@@ -723,7 +723,8 @@ do_known_hosts(struct passwd *pw, const char *name) | |||
723 | printf("# Host %s found: " | 723 | printf("# Host %s found: " |
724 | "line %d type %s\n", name, | 724 | "line %d type %s\n", name, |
725 | num, key_type(public)); | 725 | num, key_type(public)); |
726 | print_host(out, cp, public, hash_hosts); | 726 | print_host(out, name, public, |
727 | hash_hosts); | ||
727 | } | 728 | } |
728 | if (delete_host && !c) | 729 | if (delete_host && !c) |
729 | print_host(out, cp, public, 0); | 730 | print_host(out, cp, public, 0); |