summaryrefslogtreecommitdiff
path: root/authfd.c
diff options
context:
space:
mode:
Diffstat (limited to 'authfd.c')
-rw-r--r--authfd.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/authfd.c b/authfd.c
index 662350cef..8976616b4 100644
--- a/authfd.c
+++ b/authfd.c
@@ -35,7 +35,7 @@
35 */ 35 */
36 36
37#include "includes.h" 37#include "includes.h"
38RCSID("$OpenBSD: authfd.c,v 1.64 2004/08/11 21:44:31 avsm Exp $"); 38RCSID("$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)
114static int 114static int
115ssh_request_reply(AuthenticationConnection *auth, Buffer *request, Buffer *reply) 115ssh_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
303Key * 301Key *
304ssh_get_next_identity(AuthenticationConnection *auth, char **comment, int version) 302ssh_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;