=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/authfd.c,v retrieving revision 1.64 retrieving revision 1.64.2.1 diff -u -r1.64 -r1.64.2.1 --- src/usr.bin/ssh/authfd.c 2004/08/11 21:44:31 1.64 +++ src/usr.bin/ssh/authfd.c 2005/09/02 03:44:59 1.64.2.1 @@ -35,7 +35,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: authfd.c,v 1.64 2004/08/11 21:44:31 avsm Exp $"); +RCSID("$OpenBSD: authfd.c,v 1.64.2.1 2005/09/02 03:44:59 brad Exp $"); #include @@ -114,8 +114,7 @@ static int ssh_request_reply(AuthenticationConnection *auth, Buffer *request, Buffer *reply) { - int l; - u_int len; + u_int l, len; char buf[1024]; /* Get the length of the message, and format it in the buffer. */ @@ -149,8 +148,7 @@ l = len; if (l > sizeof(buf)) l = sizeof(buf); - l = atomicio(read, auth->fd, buf, l); - if (l <= 0) { + if (atomicio(read, auth->fd, buf, l) != l) { error("Error reading response from authentication socket."); return 0; } @@ -303,6 +301,7 @@ Key * ssh_get_next_identity(AuthenticationConnection *auth, char **comment, int version) { + int keybits; u_int bits; u_char *blob; u_int blen; @@ -323,7 +322,8 @@ buffer_get_bignum(&auth->identities, key->rsa->e); buffer_get_bignum(&auth->identities, key->rsa->n); *comment = buffer_get_string(&auth->identities, NULL); - if (bits != BN_num_bits(key->rsa->n)) + keybits = BN_num_bits(key->rsa->n); + if (keybits < 0 || bits != (u_int)keybits) logit("Warning: identity keysize mismatch: actual %d, announced %u", BN_num_bits(key->rsa->n), bits); break;