diff options
Diffstat (limited to 'auth2-pubkey.c')
-rw-r--r-- | auth2-pubkey.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/auth2-pubkey.c b/auth2-pubkey.c index 9898d4a63..a97d0f430 100644 --- a/auth2-pubkey.c +++ b/auth2-pubkey.c | |||
@@ -23,8 +23,9 @@ | |||
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include "includes.h" | 25 | #include "includes.h" |
26 | RCSID("$OpenBSD: auth2-pubkey.c,v 1.7 2004/06/21 17:36:31 avsm Exp $"); | 26 | RCSID("$OpenBSD: auth2-pubkey.c,v 1.9 2004/12/11 01:48:56 dtucker Exp $"); |
27 | 27 | ||
28 | #include "ssh.h" | ||
28 | #include "ssh2.h" | 29 | #include "ssh2.h" |
29 | #include "xmalloc.h" | 30 | #include "xmalloc.h" |
30 | #include "packet.h" | 31 | #include "packet.h" |
@@ -40,6 +41,7 @@ RCSID("$OpenBSD: auth2-pubkey.c,v 1.7 2004/06/21 17:36:31 avsm Exp $"); | |||
40 | #include "auth-options.h" | 41 | #include "auth-options.h" |
41 | #include "canohost.h" | 42 | #include "canohost.h" |
42 | #include "monitor_wrap.h" | 43 | #include "monitor_wrap.h" |
44 | #include "misc.h" | ||
43 | 45 | ||
44 | /* import */ | 46 | /* import */ |
45 | extern ServerOptions options; | 47 | extern ServerOptions options; |
@@ -158,7 +160,7 @@ done: | |||
158 | xfree(pkblob); | 160 | xfree(pkblob); |
159 | #ifdef HAVE_CYGWIN | 161 | #ifdef HAVE_CYGWIN |
160 | if (check_nt_auth(0, authctxt->pw) == 0) | 162 | if (check_nt_auth(0, authctxt->pw) == 0) |
161 | return(0); | 163 | authenticated = 0; |
162 | #endif | 164 | #endif |
163 | return authenticated; | 165 | return authenticated; |
164 | } | 166 | } |
@@ -167,7 +169,7 @@ done: | |||
167 | static int | 169 | static int |
168 | user_key_allowed2(struct passwd *pw, Key *key, char *file) | 170 | user_key_allowed2(struct passwd *pw, Key *key, char *file) |
169 | { | 171 | { |
170 | char line[8192]; | 172 | char line[SSH_MAX_PUBKEY_BYTES]; |
171 | int found_key = 0; | 173 | int found_key = 0; |
172 | FILE *f; | 174 | FILE *f; |
173 | u_long linenum = 0; | 175 | u_long linenum = 0; |
@@ -204,9 +206,9 @@ user_key_allowed2(struct passwd *pw, Key *key, char *file) | |||
204 | found_key = 0; | 206 | found_key = 0; |
205 | found = key_new(key->type); | 207 | found = key_new(key->type); |
206 | 208 | ||
207 | while (fgets(line, sizeof(line), f)) { | 209 | while (read_keyfile_line(f, file, line, sizeof(line), &linenum) != -1) { |
208 | char *cp, *key_options = NULL; | 210 | char *cp, *key_options = NULL; |
209 | linenum++; | 211 | |
210 | /* Skip leading whitespace, empty and comment lines. */ | 212 | /* Skip leading whitespace, empty and comment lines. */ |
211 | for (cp = line; *cp == ' ' || *cp == '\t'; cp++) | 213 | for (cp = line; *cp == ' ' || *cp == '\t'; cp++) |
212 | ; | 214 | ; |