version 1.59, 2004/06/13 12:53:24 |
version 1.60, 2004/06/21 17:36:31 |
|
|
void |
void |
kex_send_kexinit(Kex *kex) |
kex_send_kexinit(Kex *kex) |
{ |
{ |
u_int32_t rand = 0; |
u_int32_t rnd = 0; |
u_char *cookie; |
u_char *cookie; |
int i; |
int i; |
|
|
|
|
cookie = buffer_ptr(&kex->my); |
cookie = buffer_ptr(&kex->my); |
for (i = 0; i < KEX_COOKIE_LEN; i++) { |
for (i = 0; i < KEX_COOKIE_LEN; i++) { |
if (i % 4 == 0) |
if (i % 4 == 0) |
rand = arc4random(); |
rnd = arc4random(); |
cookie[i] = rand; |
cookie[i] = rnd; |
rand >>= 8; |
rnd >>= 8; |
} |
} |
packet_start(SSH2_MSG_KEXINIT); |
packet_start(SSH2_MSG_KEXINIT); |
packet_put_raw(buffer_ptr(&kex->my), buffer_len(&kex->my)); |
packet_put_raw(buffer_ptr(&kex->my), buffer_len(&kex->my)); |