diff options
author | Colin Watson <cjwatson@debian.org> | 2005-05-25 11:01:01 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2005-05-25 11:01:01 +0000 |
commit | e88de75a1a236779a10e8ccbcc51d25308be8840 (patch) | |
tree | 7495477a2a7d0cac17a9fcded020b6ea816182ef /auth-rsa.c | |
parent | 30a0f9443782cd9d7308acd09430bf586186aa55 (diff) | |
parent | 5d05471f6657646d1d6500c7c43134462c407ee6 (diff) |
Merge 4.0p1 to the trunk.
Diffstat (limited to 'auth-rsa.c')
-rw-r--r-- | auth-rsa.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/auth-rsa.c b/auth-rsa.c index 16369d47c..4378008d3 100644 --- a/auth-rsa.c +++ b/auth-rsa.c | |||
@@ -14,7 +14,7 @@ | |||
14 | */ | 14 | */ |
15 | 15 | ||
16 | #include "includes.h" | 16 | #include "includes.h" |
17 | RCSID("$OpenBSD: auth-rsa.c,v 1.60 2004/06/21 17:36:31 avsm Exp $"); | 17 | RCSID("$OpenBSD: auth-rsa.c,v 1.62 2004/12/11 01:48:56 dtucker Exp $"); |
18 | 18 | ||
19 | #include <openssl/rsa.h> | 19 | #include <openssl/rsa.h> |
20 | #include <openssl/md5.h> | 20 | #include <openssl/md5.h> |
@@ -33,6 +33,7 @@ RCSID("$OpenBSD: auth-rsa.c,v 1.60 2004/06/21 17:36:31 avsm Exp $"); | |||
33 | #include "hostfile.h" | 33 | #include "hostfile.h" |
34 | #include "monitor_wrap.h" | 34 | #include "monitor_wrap.h" |
35 | #include "ssh.h" | 35 | #include "ssh.h" |
36 | #include "misc.h" | ||
36 | 37 | ||
37 | /* import */ | 38 | /* import */ |
38 | extern ServerOptions options; | 39 | extern ServerOptions options; |
@@ -49,7 +50,7 @@ extern u_char session_id[16]; | |||
49 | * options bits e n comment | 50 | * options bits e n comment |
50 | * where bits, e and n are decimal numbers, | 51 | * where bits, e and n are decimal numbers, |
51 | * and comment is any string of characters up to newline. The maximum | 52 | * and comment is any string of characters up to newline. The maximum |
52 | * length of a line is 8000 characters. See the documentation for a | 53 | * length of a line is SSH_MAX_PUBKEY_BYTES characters. See sshd(8) for a |
53 | * description of the options. | 54 | * description of the options. |
54 | */ | 55 | */ |
55 | 56 | ||
@@ -152,7 +153,7 @@ auth_rsa_challenge_dialog(Key *key) | |||
152 | int | 153 | int |
153 | auth_rsa_key_allowed(struct passwd *pw, BIGNUM *client_n, Key **rkey) | 154 | auth_rsa_key_allowed(struct passwd *pw, BIGNUM *client_n, Key **rkey) |
154 | { | 155 | { |
155 | char line[8192], *file; | 156 | char line[SSH_MAX_PUBKEY_BYTES], *file; |
156 | int allowed = 0; | 157 | int allowed = 0; |
157 | u_int bits; | 158 | u_int bits; |
158 | FILE *f; | 159 | FILE *f; |
@@ -201,12 +202,10 @@ auth_rsa_key_allowed(struct passwd *pw, BIGNUM *client_n, Key **rkey) | |||
201 | * found, perform a challenge-response dialog to verify that the | 202 | * found, perform a challenge-response dialog to verify that the |
202 | * user really has the corresponding private key. | 203 | * user really has the corresponding private key. |
203 | */ | 204 | */ |
204 | while (fgets(line, sizeof(line), f)) { | 205 | while (read_keyfile_line(f, file, line, sizeof(line), &linenum) != -1) { |
205 | char *cp; | 206 | char *cp; |
206 | char *key_options; | 207 | char *key_options; |
207 | 208 | ||
208 | linenum++; | ||
209 | |||
210 | /* Skip leading whitespace, empty and comment lines. */ | 209 | /* Skip leading whitespace, empty and comment lines. */ |
211 | for (cp = line; *cp == ' ' || *cp == '\t'; cp++) | 210 | for (cp = line; *cp == ' ' || *cp == '\t'; cp++) |
212 | ; | 211 | ; |