diff options
author | dtucker <dtucker> | 2004-12-06 11:47:41 +0000 |
---|---|---|
committer | dtucker <dtucker> | 2004-12-06 11:47:41 +0000 |
commit | 10061e4f72b67c3146a88e2c383e3f81e3362085 (patch) | |
tree | 1264dbab6d2d874d89450714a78c785e3d80a072 /auth-rsa.c | |
parent | 9d6d459f9c2096b013cb225c9de1a3b17f3d2955 (diff) | |
download | openssh-10061e4f72b67c3146a88e2c383e3f81e3362085.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 'auth-rsa.c')
-rw-r--r-- | auth-rsa.c | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -14,7 +14,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth-rsa.c,v 1.60 2004/06/21 17:36:31 avsm Exp $"); +RCSID("$OpenBSD: auth-rsa.c,v 1.61 2004/12/06 11:41:03 dtucker Exp $"); #include <openssl/rsa.h> #include <openssl/md5.h> @@ -49,7 +49,7 @@ extern u_char session_id[16]; * options bits e n comment * where bits, e and n are decimal numbers, * and comment is any string of characters up to newline. The maximum - * length of a line is 8000 characters. See the documentation for a + * length of a line is SSH_MAX_PUBKEY_BYTES characters. See sshd(8) for a * description of the options. */ @@ -152,7 +152,7 @@ auth_rsa_challenge_dialog(Key *key) int auth_rsa_key_allowed(struct passwd *pw, BIGNUM *client_n, Key **rkey) { - char line[8192], *file; + char line[SSH_MAX_PUBKEY_BYTES], *file; int allowed = 0; u_int bits; FILE *f; @@ -201,12 +201,10 @@ auth_rsa_key_allowed(struct passwd *pw, BIGNUM *client_n, Key **rkey) * found, perform a challenge-response dialog to verify that the * user really has the corresponding private key. */ - while (fgets(line, sizeof(line), f)) { + while (read_keyfile_line(f, file, line, sizeof(line), &linenum) != -1) { char *cp; char *key_options; - linenum++; - /* Skip leading whitespace, empty and comment lines. */ for (cp = line; *cp == ' ' || *cp == '\t'; cp++) ; |