aboutsummaryrefslogtreecommitdiff
path: root/crypto/openssh/auth2-pubkey.c
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2005-06-05 15:40:50 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2005-06-05 15:40:50 +0000
commit5e8dbd04ef7b2df5ba3f8dc859ad6e472ce1c534 (patch)
tree7767975616a98948a7ef791c43b28a21711a22c7 /crypto/openssh/auth2-pubkey.c
parentd74d50a84bda49cca847afc2f65bf790d6af7361 (diff)
downloadsrc-5e8dbd04ef7b2df5ba3f8dc859ad6e472ce1c534.tar.gz
src-5e8dbd04ef7b2df5ba3f8dc859ad6e472ce1c534.zip
Vendor import of OpenSSH 4.0p1.
Notes
Notes: svn path=/vendor-crypto/openssh/dist/; revision=146998
Diffstat (limited to 'crypto/openssh/auth2-pubkey.c')
-rw-r--r--crypto/openssh/auth2-pubkey.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/crypto/openssh/auth2-pubkey.c b/crypto/openssh/auth2-pubkey.c
index 9898d4a63b8c..a97d0f430b93 100644
--- a/crypto/openssh/auth2-pubkey.c
+++ b/crypto/openssh/auth2-pubkey.c
@@ -23,8 +23,9 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: auth2-pubkey.c,v 1.7 2004/06/21 17:36:31 avsm Exp $");
+RCSID("$OpenBSD: auth2-pubkey.c,v 1.9 2004/12/11 01:48:56 dtucker Exp $");
+#include "ssh.h"
#include "ssh2.h"
#include "xmalloc.h"
#include "packet.h"
@@ -40,6 +41,7 @@ RCSID("$OpenBSD: auth2-pubkey.c,v 1.7 2004/06/21 17:36:31 avsm Exp $");
#include "auth-options.h"
#include "canohost.h"
#include "monitor_wrap.h"
+#include "misc.h"
/* import */
extern ServerOptions options;
@@ -158,7 +160,7 @@ done:
xfree(pkblob);
#ifdef HAVE_CYGWIN
if (check_nt_auth(0, authctxt->pw) == 0)
- return(0);
+ authenticated = 0;
#endif
return authenticated;
}
@@ -167,7 +169,7 @@ done:
static int
user_key_allowed2(struct passwd *pw, Key *key, char *file)
{
- char line[8192];
+ char line[SSH_MAX_PUBKEY_BYTES];
int found_key = 0;
FILE *f;
u_long linenum = 0;
@@ -204,9 +206,9 @@ user_key_allowed2(struct passwd *pw, Key *key, char *file)
found_key = 0;
found = key_new(key->type);
- while (fgets(line, sizeof(line), f)) {
+ while (read_keyfile_line(f, file, line, sizeof(line), &linenum) != -1) {
char *cp, *key_options = NULL;
- linenum++;
+
/* Skip leading whitespace, empty and comment lines. */
for (cp = line; *cp == ' ' || *cp == '\t'; cp++)
;