diff options
Diffstat (limited to 'auth-rsa.c')
-rw-r--r-- | auth-rsa.c | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/auth-rsa.c b/auth-rsa.c index 69f9a5896..bf5462076 100644 --- a/auth-rsa.c +++ b/auth-rsa.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: auth-rsa.c,v 1.72 2006/11/06 21:25:27 markus Exp $ */ | 1 | /* $OpenBSD: auth-rsa.c,v 1.73 2008/07/02 12:03:51 dtucker Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -173,7 +173,6 @@ auth_rsa_key_allowed(struct passwd *pw, BIGNUM *client_n, Key **rkey) | |||
173 | u_int bits; | 173 | u_int bits; |
174 | FILE *f; | 174 | FILE *f; |
175 | u_long linenum = 0; | 175 | u_long linenum = 0; |
176 | struct stat st; | ||
177 | Key *key; | 176 | Key *key; |
178 | 177 | ||
179 | /* Temporarily use the user's uid. */ | 178 | /* Temporarily use the user's uid. */ |
@@ -182,27 +181,9 @@ auth_rsa_key_allowed(struct passwd *pw, BIGNUM *client_n, Key **rkey) | |||
182 | /* The authorized keys. */ | 181 | /* The authorized keys. */ |
183 | file = authorized_keys_file(pw); | 182 | file = authorized_keys_file(pw); |
184 | debug("trying public RSA key file %s", file); | 183 | debug("trying public RSA key file %s", file); |
185 | 184 | f = auth_openkeyfile(file, pw, options.strict_modes); | |
186 | /* Fail quietly if file does not exist */ | ||
187 | if (stat(file, &st) < 0) { | ||
188 | /* Restore the privileged uid. */ | ||
189 | restore_uid(); | ||
190 | xfree(file); | ||
191 | return (0); | ||
192 | } | ||
193 | /* Open the file containing the authorized keys. */ | ||
194 | f = fopen(file, "r"); | ||
195 | if (!f) { | 185 | if (!f) { |
196 | /* Restore the privileged uid. */ | ||
197 | restore_uid(); | ||
198 | xfree(file); | ||
199 | return (0); | ||
200 | } | ||
201 | if (options.strict_modes && | ||
202 | secure_filename(f, file, pw, line, sizeof(line)) != 0) { | ||
203 | xfree(file); | 186 | xfree(file); |
204 | fclose(f); | ||
205 | logit("Authentication refused: %s", line); | ||
206 | restore_uid(); | 187 | restore_uid(); |
207 | return (0); | 188 | return (0); |
208 | } | 189 | } |