[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openssh-unix-dev
Subject:    PATCH: incorrect behaviour of 'ssh-keygen -HF'
From:       Jan Pechanec <Jan.Pechanec () Sun ! COM>
Date:       2007-10-10 16:08:11
Message-ID: Pine.GSO.4.61.0710101756420.102002 () fossa ! czech ! sun ! com
[Download RAW message or body]

hi, the corner case of '-HF' hashes the whole hostline and not just 
the host xor IP address which means that usually it will hash "HOST,IP". 
This will never be matched if manually included into the known_host file. 
Patch against 4.7p1 attached.

	J.

-- 
Jan Pechanec

["ssh-keygen_HF.patch;" (ssh-keygen_HF.patch;)]

--- openssh-4.7p1/ssh-keygen.c	Mon Feb 19 12:10:25 2007
+++ openssh-4.7p1-patched/ssh-keygen.c	Wed Oct 10 17:38:05 2007
@@ -598,7 +598,7 @@
 }
 
 static void
-print_host(FILE *f, char *name, Key *public, int hash)
+print_host(FILE *f, const char *name, Key *public, int hash)
 {
 	if (hash && (name = host_hash(name, NULL, 0)) == NULL)
 		fatal("hash_host failed");
@@ -726,7 +726,7 @@
 					printf("# Host %s found: "
 					    "line %d type %s\n", name,
 					    num, key_type(public));
-					print_host(out, cp, public, hash_hosts);
+					print_host(out, name, public, hash_hosts);
 				}
 				if (delete_host && !c)
 					print_host(out, cp, public, 0);


_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@mindrot.org
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic