summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2005-03-02 12:33:04 +1100
committerDamien Miller <djm@mindrot.org>2005-03-02 12:33:04 +1100
commit89eac8010a80589bcd3abda8f253cd0cd3d2088c (patch)
treea7d2ad7e01871352959b6d1bf3ade6e386cd0222
parent1227d4c93c44d09694e547b62b643afa2a321a17 (diff)
- djm@cvs.openbsd.org 2005/03/02 01:27:41
[ssh-keygen.c] ignore hostnames with metachars when hashing; ok deraadt@
-rw-r--r--ChangeLog5
-rw-r--r--ssh-keygen.c13
2 files changed, 14 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index a5554745f..5ba0ac303 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -39,6 +39,9 @@
39 [sshconnect.c] 39 [sshconnect.c]
40 fix addition of new hashed hostnames when CheckHostIP=yes; 40 fix addition of new hashed hostnames when CheckHostIP=yes;
41 found and ok dtucker@ 41 found and ok dtucker@
42 - djm@cvs.openbsd.org 2005/03/02 01:27:41
43 [ssh-keygen.c]
44 ignore hostnames with metachars when hashing; ok deraadt@
42 45
4320050301 4620050301
44 - (djm) OpenBSD CVS sync: 47 - (djm) OpenBSD CVS sync:
@@ -2258,4 +2261,4 @@
2258 - (djm) Trim deprecated options from INSTALL. Mention UsePAM 2261 - (djm) Trim deprecated options from INSTALL. Mention UsePAM
2259 - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu 2262 - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu
2260 2263
2261$Id: ChangeLog,v 1.3685 2005/03/02 01:06:51 djm Exp $ 2264$Id: ChangeLog,v 1.3686 2005/03/02 01:33:04 djm Exp $
diff --git a/ssh-keygen.c b/ssh-keygen.c
index 00ddb90c8..a9931d4d8 100644
--- a/ssh-keygen.c
+++ b/ssh-keygen.c
@@ -12,7 +12,7 @@
12 */ 12 */
13 13
14#include "includes.h" 14#include "includes.h"
15RCSID("$OpenBSD: ssh-keygen.c,v 1.119 2005/03/01 10:42:49 djm Exp $"); 15RCSID("$OpenBSD: ssh-keygen.c,v 1.120 2005/03/02 01:27:41 djm Exp $");
16 16
17#include <openssl/evp.h> 17#include <openssl/evp.h>
18#include <openssl/pem.h> 18#include <openssl/pem.h>
@@ -686,8 +686,15 @@ do_known_hosts(struct passwd *pw, const char *name)
686 } else if (hash_hosts) { 686 } else if (hash_hosts) {
687 for(cp2 = strsep(&cp, ","); 687 for(cp2 = strsep(&cp, ",");
688 cp2 != NULL && *cp2 != '\0'; 688 cp2 != NULL && *cp2 != '\0';
689 cp2 = strsep(&cp, ",")) 689 cp2 = strsep(&cp, ",")) {
690 print_host(out, cp2, public, 1); 690 if (strcspn(cp2, "*?!") != strlen(cp2))
691 fprintf(stderr, "Warning: "
692 "ignoring host name with "
693 "metacharacters: %.64s\n",
694 cp2);
695 else
696 print_host(out, cp2, public, 1);
697 }
691 has_unhashed = 1; 698 has_unhashed = 1;
692 } 699 }
693 } 700 }