=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/Attic/auth-rsa.c,v retrieving revision 1.58.2.2 retrieving revision 1.59 diff -u -r1.58.2.2 -r1.59 --- src/usr.bin/ssh/Attic/auth-rsa.c 2005/03/10 17:15:04 1.58.2.2 +++ src/usr.bin/ssh/Attic/auth-rsa.c 2004/05/09 01:19:27 1.59 @@ -14,7 +14,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth-rsa.c,v 1.58.2.2 2005/03/10 17:15:04 brad Exp $"); +RCSID("$OpenBSD: auth-rsa.c,v 1.59 2004/05/09 01:19:27 djm Exp $"); #include #include @@ -33,7 +33,6 @@ #include "hostfile.h" #include "monitor_wrap.h" #include "ssh.h" -#include "misc.h" /* import */ extern ServerOptions options; @@ -50,7 +49,7 @@ * 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 SSH_MAX_PUBKEY_BYTES characters. See sshd(8) for a + * length of a line is 8000 characters. See the documentation for a * description of the options. */ @@ -153,7 +152,7 @@ int auth_rsa_key_allowed(struct passwd *pw, BIGNUM *client_n, Key **rkey) { - char line[SSH_MAX_PUBKEY_BYTES], *file; + char line[8192], *file; int allowed = 0; u_int bits; FILE *f; @@ -202,10 +201,12 @@ * found, perform a challenge-response dialog to verify that the * user really has the corresponding private key. */ - while (read_keyfile_line(f, file, line, sizeof(line), &linenum) != -1) { + while (fgets(line, sizeof(line), f)) { char *cp; - char *key_options; + char *options; + linenum++; + /* Skip leading whitespace, empty and comment lines. */ for (cp = line; *cp == ' ' || *cp == '\t'; cp++) ; @@ -220,7 +221,7 @@ */ if (*cp < '0' || *cp > '9') { int quoted = 0; - key_options = cp; + options = cp; for (; *cp && (quoted || (*cp != ' ' && *cp != '\t')); cp++) { if (*cp == '\\' && cp[1] == '"') cp++; /* Skip both */ @@ -228,7 +229,7 @@ quoted = !quoted; } } else - key_options = NULL; + options = NULL; /* Parse the key from the line. */ if (hostfile_read_key(&cp, &bits, key) == 0) { @@ -253,7 +254,7 @@ * If our options do not allow this key to be used, * do not send challenge. */ - if (!auth_parse_options(pw, key_options, file, linenum)) + if (!auth_parse_options(pw, options, file, linenum)) continue; /* break out, this key is allowed */