From 3219824f2d8b0ea1711818745b046931ffcd3918 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Sun, 15 May 2011 08:50:32 +1000 Subject: - djm@cvs.openbsd.org 2011/05/10 05:46:46 [authfile.c] despam debug() logs by detecting that we are trying to load a private key in key_try_load_public() and returning early; ok markus@ --- authfile.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'authfile.c') diff --git a/authfile.c b/authfile.c index 608d1d06f..7a5b65142 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 * Copyright (c) 1995 Tatu Ylonen , 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++) ; -- cgit v1.2.3