diff options
author | Damien Miller <djm@cvs.openbsd.org> | 2011-05-10 05:46:47 +0000 |
---|---|---|
committer | Damien Miller <djm@cvs.openbsd.org> | 2011-05-10 05:46:47 +0000 |
commit | dac3d910f2eddde822883c13424eaa6c530baa30 (patch) | |
tree | 48cdbdc00580d908328937de837748fd88d8a890 | |
parent | 668e12be2e7a9b8d31f454d705ea8a7f5dcbd3ce (diff) |
despam debug() logs by detecting that we are trying to load a private key
in key_try_load_public() and returning early; ok markus@
-rw-r--r-- | usr.bin/ssh/authfile.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/ssh/authfile.c b/usr.bin/ssh/authfile.c index dae41798aba..116c680338a 100644 --- a/usr.bin/ssh/authfile.c +++ b/usr.bin/ssh/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 @@ -749,6 +749,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++) ; |