version 1.56.4.1, 2004/08/19 04:13:27 |
version 1.57, 2004/05/08 00:21:31 |
|
|
#include "rsa.h" |
#include "rsa.h" |
#include "buffer.h" |
#include "buffer.h" |
#include "packet.h" |
#include "packet.h" |
#include "kex.h" |
#include "mpaux.h" |
#include "uidswap.h" |
#include "uidswap.h" |
#include "log.h" |
#include "log.h" |
#include "readconf.h" |
#include "readconf.h" |
|
|
u_char cookie[8]; |
u_char cookie[8]; |
u_int supported_ciphers; |
u_int supported_ciphers; |
u_int server_flags, client_flags; |
u_int server_flags, client_flags; |
u_int32_t rnd = 0; |
u_int32_t rand = 0; |
|
|
debug("Waiting for server public key."); |
debug("Waiting for server public key."); |
|
|
|
|
|
|
client_flags = SSH_PROTOFLAG_SCREEN_NUMBER | SSH_PROTOFLAG_HOST_IN_FWD_OPEN; |
client_flags = SSH_PROTOFLAG_SCREEN_NUMBER | SSH_PROTOFLAG_HOST_IN_FWD_OPEN; |
|
|
derive_ssh1_session_id(host_key->rsa->n, server_key->rsa->n, cookie, session_id); |
compute_session_id(session_id, cookie, host_key->rsa->n, server_key->rsa->n); |
|
|
/* Generate a session key. */ |
/* Generate a session key. */ |
arc4random_stir(); |
arc4random_stir(); |
|
|
*/ |
*/ |
for (i = 0; i < 32; i++) { |
for (i = 0; i < 32; i++) { |
if (i % 4 == 0) |
if (i % 4 == 0) |
rnd = arc4random(); |
rand = arc4random(); |
session_key[i] = rnd & 0xff; |
session_key[i] = rand & 0xff; |
rnd >>= 8; |
rand >>= 8; |
} |
} |
|
|
/* |
/* |
|
|
if (options.cipher == SSH_CIPHER_NOT_SET) { |
if (options.cipher == SSH_CIPHER_NOT_SET) { |
if (cipher_mask_ssh1(1) & supported_ciphers & (1 << ssh_cipher_default)) |
if (cipher_mask_ssh1(1) & supported_ciphers & (1 << ssh_cipher_default)) |
options.cipher = ssh_cipher_default; |
options.cipher = ssh_cipher_default; |
} else if (options.cipher == SSH_CIPHER_INVALID || |
} else if (options.cipher == SSH_CIPHER_ILLEGAL || |
!(cipher_mask_ssh1(1) & (1 << options.cipher))) { |
!(cipher_mask_ssh1(1) & (1 << options.cipher))) { |
logit("No valid SSH1 cipher, using %.100s instead.", |
logit("No valid SSH1 cipher, using %.100s instead.", |
cipher_name(ssh_cipher_default)); |
cipher_name(ssh_cipher_default)); |