version 1.2, 2002/03/19 10:35:39 |
version 1.3, 2002/03/19 10:41:32 |
|
|
|
|
if (pent != NULL) |
if (pent != NULL) |
*pent = ent; |
*pent = ent; |
|
|
return ret; |
return ret; |
} |
} |
|
|
fatal("%s: unsupported request: %d\n", __FUNCTION__, type); |
fatal("%s: unsupported request: %d\n", __FUNCTION__, type); |
|
|
/* NOTREACHED */ |
/* NOTREACHED */ |
return (-1); |
return (-1); |
|
|
buffer_put_char(m, 1); |
buffer_put_char(m, 1); |
buffer_put_bignum2(m, dh->p); |
buffer_put_bignum2(m, dh->p); |
buffer_put_bignum2(m, dh->g); |
buffer_put_bignum2(m, dh->g); |
|
|
DH_free(dh); |
DH_free(dh); |
} |
} |
mm_request_send(socket, MONITOR_ANS_MODULI, m); |
mm_request_send(socket, MONITOR_ANS_MODULI, m); |
|
|
u_char *signature; |
u_char *signature; |
u_int siglen, datlen; |
u_int siglen, datlen; |
int keyid; |
int keyid; |
|
|
debug3("%s", __FUNCTION__); |
debug3("%s", __FUNCTION__); |
|
|
keyid = buffer_get_int(m); |
keyid = buffer_get_int(m); |
p = buffer_get_string(m, &datlen); |
p = buffer_get_string(m, &datlen); |
|
|
if (datlen != 20) |
if (datlen != 20) |
fatal("%s: data length incorrect: %d", __FUNCTION__, datlen); |
fatal("%s: data length incorrect: %d", __FUNCTION__, datlen); |
|
|
char *login; |
char *login; |
struct passwd *pwent; |
struct passwd *pwent; |
int allowed = 0; |
int allowed = 0; |
|
|
debug3("%s", __FUNCTION__); |
debug3("%s", __FUNCTION__); |
|
|
if (authctxt->attempt++ != 0) |
if (authctxt->attempt++ != 0) |
|
|
int allowed = 0; |
int allowed = 0; |
|
|
debug3("%s entering", __FUNCTION__); |
debug3("%s entering", __FUNCTION__); |
|
|
type = buffer_get_int(m); |
type = buffer_get_int(m); |
cuser = buffer_get_string(m, NULL); |
cuser = buffer_get_string(m, NULL); |
chost = buffer_get_string(m, NULL); |
chost = buffer_get_string(m, NULL); |
|
|
|
|
buffer_init(&b); |
buffer_init(&b); |
buffer_append(&b, data, datalen); |
buffer_append(&b, data, datalen); |
|
|
if (datafellows & SSH_OLD_SESSIONID) { |
if (datafellows & SSH_OLD_SESSIONID) { |
buffer_consume(&b, session_id2_len); |
buffer_consume(&b, session_id2_len); |
} else { |
} else { |
|
|
|
|
buffer_init(&b); |
buffer_init(&b); |
buffer_append(&b, data, datalen); |
buffer_append(&b, data, datalen); |
|
|
xfree(buffer_get_string(&b, &len)); |
xfree(buffer_get_string(&b, &len)); |
if (len != session_id2_len) |
if (len != session_id2_len) |
fail++; |
fail++; |
|
|
xfree(data); |
xfree(data); |
|
|
monitor_reset_key_state(); |
monitor_reset_key_state(); |
|
|
buffer_clear(m); |
buffer_clear(m); |
buffer_put_int(m, verified); |
buffer_put_int(m, verified); |
mm_request_send(socket, MONITOR_ANS_KEYVERIFY, m); |
mm_request_send(socket, MONITOR_ANS_KEYVERIFY, m); |
|
|
{ |
{ |
BIGNUM *client_n; |
BIGNUM *client_n; |
Key *key = NULL; |
Key *key = NULL; |
u_char *blob = NULL; |
u_char *blob = NULL; |
u_int blen = 0; |
u_int blen = 0; |
int allowed = 0; |
int allowed = 0; |
|
|
debug3("%s entering", __FUNCTION__); |
debug3("%s entering", __FUNCTION__); |
|
|
mm_answer_rsa_challenge(int socket, Buffer *m) |
mm_answer_rsa_challenge(int socket, Buffer *m) |
{ |
{ |
Key *key = NULL; |
Key *key = NULL; |
u_char *blob; |
u_char *blob; |
u_int blen; |
u_int blen; |
|
|
debug3("%s entering", __FUNCTION__); |
debug3("%s entering", __FUNCTION__); |
|
|
|
|
mm_answer_rsa_response(int socket, Buffer *m) |
mm_answer_rsa_response(int socket, Buffer *m) |
{ |
{ |
Key *key = NULL; |
Key *key = NULL; |
u_char *blob, *response; |
u_char *blob, *response; |
u_int blen, len; |
u_int blen, len; |
int success; |
int success; |
|
|
debug3("%s entering", __FUNCTION__); |
debug3("%s entering", __FUNCTION__); |
|
|
|
|
sizeof(incoming_stream)); |
sizeof(incoming_stream)); |
memcpy(&outgoing_stream, &child_state.outgoing, |
memcpy(&outgoing_stream, &child_state.outgoing, |
sizeof(outgoing_stream)); |
sizeof(outgoing_stream)); |
|
|
/* Update with new address */ |
/* Update with new address */ |
mm_init_compression(monitor->m_zlib); |
mm_init_compression(monitor->m_zlib); |
|
|
|
|
blob = buffer_get_string(&m, &bloblen); |
blob = buffer_get_string(&m, &bloblen); |
current_keys[MODE_IN] = mm_newkeys_from_blob(blob, bloblen); |
current_keys[MODE_IN] = mm_newkeys_from_blob(blob, bloblen); |
xfree(blob); |
xfree(blob); |
|
|
/* Now get sequence numbers for the packets */ |
/* Now get sequence numbers for the packets */ |
packet_set_seqnr(MODE_OUT, buffer_get_int(&m)); |
packet_set_seqnr(MODE_OUT, buffer_get_int(&m)); |
packet_set_seqnr(MODE_IN, buffer_get_int(&m)); |
packet_set_seqnr(MODE_IN, buffer_get_int(&m)); |
|
|
|
|
static void |
static void |
monitor_socketpair(int *pair) |
monitor_socketpair(int *pair) |
{ |
{ |
if (socketpair(AF_UNIX, SOCK_STREAM, 0, pair) == -1) |
if (socketpair(AF_UNIX, SOCK_STREAM, 0, pair) == -1) |
fatal("%s: socketpair", __FUNCTION__); |
fatal("%s: socketpair", __FUNCTION__); |
FD_CLOSEONEXEC(pair[0]); |
FD_CLOSEONEXEC(pair[0]); |