diff options
author | Darren Tucker <dtucker@zip.com.au> | 2004-12-06 22:47:41 +1100 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2004-12-06 22:47:41 +1100 |
commit | 22cc741096c85ff211dfc4c910fd28ec4858ba83 (patch) | |
tree | 312742d9b3a62da80833cb224d1df1778b2104cd /authfile.c | |
parent | 16e254d17934437a811e0019107ad53cdea8eb76 (diff) |
- 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.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/authfile.c b/authfile.c index 1c006c43d..4038ab692 100644 --- a/authfile.c +++ b/authfile.c | |||
@@ -36,7 +36,7 @@ | |||
36 | */ | 36 | */ |
37 | 37 | ||
38 | #include "includes.h" | 38 | #include "includes.h" |
39 | RCSID("$OpenBSD: authfile.c,v 1.58 2004/08/23 11:48:09 djm Exp $"); | 39 | RCSID("$OpenBSD: authfile.c,v 1.59 2004/12/06 11:41:03 dtucker Exp $"); |
40 | 40 | ||
41 | #include <openssl/err.h> | 41 | #include <openssl/err.h> |
42 | #include <openssl/evp.h> | 42 | #include <openssl/evp.h> |
@@ -601,13 +601,14 @@ static int | |||
601 | key_try_load_public(Key *k, const char *filename, char **commentp) | 601 | key_try_load_public(Key *k, const char *filename, char **commentp) |
602 | { | 602 | { |
603 | FILE *f; | 603 | FILE *f; |
604 | char line[4096]; | 604 | char line[SSH_MAX_PUBKEY_BYTES]; |
605 | char *cp; | 605 | char *cp; |
606 | int linenum = 0; | ||
606 | 607 | ||
607 | f = fopen(filename, "r"); | 608 | f = fopen(filename, "r"); |
608 | if (f != NULL) { | 609 | if (f != NULL) { |
609 | while (fgets(line, sizeof(line), f)) { | 610 | while (read_keyfile_line(f, filename, line, sizeof(line), |
610 | line[sizeof(line)-1] = '\0'; | 611 | &linenum) != -1) { |
611 | cp = line; | 612 | cp = line; |
612 | switch (*cp) { | 613 | switch (*cp) { |
613 | case '#': | 614 | case '#': |