summaryrefslogtreecommitdiffstats
path: root/authfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'authfile.c')
-rw-r--r--authfile.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/authfile.c b/authfile.c
index 608d1d06..7a5b6514 100644
--- a/authfile.c
+++ b/authfile.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: authfile.c,v 1.88 2011/05/04 21:15:29 djm Exp $ */
+/* $OpenBSD: authfile.c,v 1.89 2011/05/10 05:46:46 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -765,6 +765,9 @@ key_try_load_public(Key *k, const char *filename, char **commentp)
case '\0':
continue;
}
+ /* Abort loading if this looks like a private key */
+ if (strncmp(cp, "-----BEGIN", 10) == 0)
+ break;
/* Skip leading whitespace. */
for (; *cp && (*cp == ' ' || *cp == '\t'); cp++)
;