diff options
author | Colin Watson <cjwatson@debian.org> | 2009-12-29 21:32:03 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2009-12-29 21:32:03 +0000 |
commit | 04942aa41fa94ec6f2c3ce1d348f600f31bb7c78 (patch) | |
tree | af8e928bd79d3f2d0219bb5b2c78b573ec31d94c /authfd.c | |
parent | 9ad7b718d42e43f3a285fcbc8f91193931fce324 (diff) | |
parent | 16704d57999d987fb8d9ba53379841a79f016d67 (diff) |
import openssh-4.2p1-gsskex-20050926-2.patch
Diffstat (limited to 'authfd.c')
-rw-r--r-- | authfd.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -35,7 +35,7 @@ | |||
35 | */ | 35 | */ |
36 | 36 | ||
37 | #include "includes.h" | 37 | #include "includes.h" |
38 | RCSID("$OpenBSD: authfd.c,v 1.64 2004/08/11 21:44:31 avsm Exp $"); | 38 | RCSID("$OpenBSD: authfd.c,v 1.66 2005/06/17 02:44:32 djm Exp $"); |
39 | 39 | ||
40 | #include <openssl/evp.h> | 40 | #include <openssl/evp.h> |
41 | 41 | ||
@@ -114,8 +114,7 @@ ssh_get_authentication_socket(void) | |||
114 | static int | 114 | static int |
115 | ssh_request_reply(AuthenticationConnection *auth, Buffer *request, Buffer *reply) | 115 | ssh_request_reply(AuthenticationConnection *auth, Buffer *request, Buffer *reply) |
116 | { | 116 | { |
117 | int l; | 117 | u_int l, len; |
118 | u_int len; | ||
119 | char buf[1024]; | 118 | char buf[1024]; |
120 | 119 | ||
121 | /* Get the length of the message, and format it in the buffer. */ | 120 | /* Get the length of the message, and format it in the buffer. */ |
@@ -149,8 +148,7 @@ ssh_request_reply(AuthenticationConnection *auth, Buffer *request, Buffer *reply | |||
149 | l = len; | 148 | l = len; |
150 | if (l > sizeof(buf)) | 149 | if (l > sizeof(buf)) |
151 | l = sizeof(buf); | 150 | l = sizeof(buf); |
152 | l = atomicio(read, auth->fd, buf, l); | 151 | if (atomicio(read, auth->fd, buf, l) != l) { |
153 | if (l <= 0) { | ||
154 | error("Error reading response from authentication socket."); | 152 | error("Error reading response from authentication socket."); |
155 | return 0; | 153 | return 0; |
156 | } | 154 | } |
@@ -303,6 +301,7 @@ ssh_get_first_identity(AuthenticationConnection *auth, char **comment, int versi | |||
303 | Key * | 301 | Key * |
304 | ssh_get_next_identity(AuthenticationConnection *auth, char **comment, int version) | 302 | ssh_get_next_identity(AuthenticationConnection *auth, char **comment, int version) |
305 | { | 303 | { |
304 | int keybits; | ||
306 | u_int bits; | 305 | u_int bits; |
307 | u_char *blob; | 306 | u_char *blob; |
308 | u_int blen; | 307 | u_int blen; |
@@ -323,7 +322,8 @@ ssh_get_next_identity(AuthenticationConnection *auth, char **comment, int versio | |||
323 | buffer_get_bignum(&auth->identities, key->rsa->e); | 322 | buffer_get_bignum(&auth->identities, key->rsa->e); |
324 | buffer_get_bignum(&auth->identities, key->rsa->n); | 323 | buffer_get_bignum(&auth->identities, key->rsa->n); |
325 | *comment = buffer_get_string(&auth->identities, NULL); | 324 | *comment = buffer_get_string(&auth->identities, NULL); |
326 | if (bits != BN_num_bits(key->rsa->n)) | 325 | keybits = BN_num_bits(key->rsa->n); |
326 | if (keybits < 0 || bits != (u_int)keybits) | ||
327 | logit("Warning: identity keysize mismatch: actual %d, announced %u", | 327 | logit("Warning: identity keysize mismatch: actual %d, announced %u", |
328 | BN_num_bits(key->rsa->n), bits); | 328 | BN_num_bits(key->rsa->n), bits); |
329 | break; | 329 | break; |