version 1.64, 2004/08/11 21:44:31 |
version 1.64.4.1, 2005/09/04 18:39:59 |
|
|
static int |
static int |
ssh_request_reply(AuthenticationConnection *auth, Buffer *request, Buffer *reply) |
ssh_request_reply(AuthenticationConnection *auth, Buffer *request, Buffer *reply) |
{ |
{ |
int l; |
u_int l, len; |
u_int len; |
|
char buf[1024]; |
char buf[1024]; |
|
|
/* Get the length of the message, and format it in the buffer. */ |
/* Get the length of the message, and format it in the buffer. */ |
|
|
l = len; |
l = len; |
if (l > sizeof(buf)) |
if (l > sizeof(buf)) |
l = sizeof(buf); |
l = sizeof(buf); |
l = atomicio(read, auth->fd, buf, l); |
if (atomicio(read, auth->fd, buf, l) != l) { |
if (l <= 0) { |
|
error("Error reading response from authentication socket."); |
error("Error reading response from authentication socket."); |
return 0; |
return 0; |
} |
} |
|
|
Key * |
Key * |
ssh_get_next_identity(AuthenticationConnection *auth, char **comment, int version) |
ssh_get_next_identity(AuthenticationConnection *auth, char **comment, int version) |
{ |
{ |
|
int keybits; |
u_int bits; |
u_int bits; |
u_char *blob; |
u_char *blob; |
u_int blen; |
u_int blen; |
|
|
buffer_get_bignum(&auth->identities, key->rsa->e); |
buffer_get_bignum(&auth->identities, key->rsa->e); |
buffer_get_bignum(&auth->identities, key->rsa->n); |
buffer_get_bignum(&auth->identities, key->rsa->n); |
*comment = buffer_get_string(&auth->identities, NULL); |
*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", |
logit("Warning: identity keysize mismatch: actual %d, announced %u", |
BN_num_bits(key->rsa->n), bits); |
BN_num_bits(key->rsa->n), bits); |
break; |
break; |