summaryrefslogtreecommitdiff
path: root/authfile.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2004-12-06 22:47:41 +1100
committerDarren Tucker <dtucker@zip.com.au>2004-12-06 22:47:41 +1100
commit22cc741096c85ff211dfc4c910fd28ec4858ba83 (patch)
tree312742d9b3a62da80833cb224d1df1778b2104cd /authfile.c
parent16e254d17934437a811e0019107ad53cdea8eb76 (diff)
downloadopenssh-git-22cc741096c85ff211dfc4c910fd28ec4858ba83.tar.gz
- dtucker@cvs.openbsd.org 2004/12/06 11:41:03
[auth-rsa.c auth2-pubkey.c authfile.c misc.c misc.h ssh.h sshd.8] Discard over-length authorized_keys entries rather than complaining when they don't decode. bz #884, with & ok djm@
Diffstat (limited to 'authfile.c')
-rw-r--r--authfile.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/authfile.c b/authfile.c
index 1c006c43..4038ab69 100644
--- a/authfile.c
+++ b/authfile.c
@@ -36,7 +36,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: authfile.c,v 1.58 2004/08/23 11:48:09 djm Exp $");
+RCSID("$OpenBSD: authfile.c,v 1.59 2004/12/06 11:41:03 dtucker Exp $");
#include <openssl/err.h>
#include <openssl/evp.h>
@@ -601,13 +601,14 @@ static int
key_try_load_public(Key *k, const char *filename, char **commentp)
{
FILE *f;
- char line[4096];
+ char line[SSH_MAX_PUBKEY_BYTES];
char *cp;
+ int linenum = 0;
f = fopen(filename, "r");
if (f != NULL) {
- while (fgets(line, sizeof(line), f)) {
- line[sizeof(line)-1] = '\0';
+ while (read_keyfile_line(f, filename, line, sizeof(line),
+ &linenum) != -1) {
cp = line;
switch (*cp) {
case '#':