version 1.72, 2006/11/06 21:25:27 |
version 1.73, 2008/07/02 12:03:51 |
|
|
u_int bits; |
u_int bits; |
FILE *f; |
FILE *f; |
u_long linenum = 0; |
u_long linenum = 0; |
struct stat st; |
|
Key *key; |
Key *key; |
|
|
/* Temporarily use the user's uid. */ |
/* Temporarily use the user's uid. */ |
|
|
/* The authorized keys. */ |
/* The authorized keys. */ |
file = authorized_keys_file(pw); |
file = authorized_keys_file(pw); |
debug("trying public RSA key file %s", file); |
debug("trying public RSA key file %s", file); |
|
f = auth_openkeyfile(file, pw, options.strict_modes); |
/* Fail quietly if file does not exist */ |
|
if (stat(file, &st) < 0) { |
|
/* Restore the privileged uid. */ |
|
restore_uid(); |
|
xfree(file); |
|
return (0); |
|
} |
|
/* Open the file containing the authorized keys. */ |
|
f = fopen(file, "r"); |
|
if (!f) { |
if (!f) { |
/* Restore the privileged uid. */ |
|
restore_uid(); |
|
xfree(file); |
xfree(file); |
return (0); |
|
} |
|
if (options.strict_modes && |
|
secure_filename(f, file, pw, line, sizeof(line)) != 0) { |
|
xfree(file); |
|
fclose(f); |
|
logit("Authentication refused: %s", line); |
|
restore_uid(); |
restore_uid(); |
return (0); |
return (0); |
} |
} |