version 1.25, 1999/11/02 19:42:36 |
version 1.26, 1999/11/07 22:38:39 |
|
|
BIGNUM *key; |
BIGNUM *key; |
RSA *host_key, *file_key; |
RSA *host_key, *file_key; |
RSA *public_key; |
RSA *public_key; |
|
int bits, rbits; |
unsigned char session_key[SSH_SESSION_KEY_LENGTH]; |
unsigned char session_key[SSH_SESSION_KEY_LENGTH]; |
const char *server_user, *local_user; |
const char *server_user, *local_user; |
char *cp, *host, *ip = NULL; |
char *cp, *host, *ip = NULL; |
|
|
|
|
/* Get the public key. */ |
/* Get the public key. */ |
public_key = RSA_new(); |
public_key = RSA_new(); |
packet_get_int(); /* bits */ |
bits = packet_get_int(); /* bits */ |
public_key->e = BN_new(); |
public_key->e = BN_new(); |
packet_get_bignum(public_key->e, &clen); |
packet_get_bignum(public_key->e, &clen); |
sum_len += clen; |
sum_len += clen; |
|
|
packet_get_bignum(public_key->n, &clen); |
packet_get_bignum(public_key->n, &clen); |
sum_len += clen; |
sum_len += clen; |
|
|
|
rbits = BN_num_bits(public_key->n); |
|
if (bits != rbits) { |
|
log("Warning: Server lies about size of server public key,"); |
|
log("Warning: this may be due to an old implementation of ssh."); |
|
log("Warning: (actual size %d bits, announced size %d bits)", rbits, bits); |
|
} |
|
|
/* Get the host key. */ |
/* Get the host key. */ |
host_key = RSA_new(); |
host_key = RSA_new(); |
packet_get_int(); /* bits */ |
bits = packet_get_int(); /* bits */ |
host_key->e = BN_new(); |
host_key->e = BN_new(); |
packet_get_bignum(host_key->e, &clen); |
packet_get_bignum(host_key->e, &clen); |
sum_len += clen; |
sum_len += clen; |
host_key->n = BN_new(); |
host_key->n = BN_new(); |
packet_get_bignum(host_key->n, &clen); |
packet_get_bignum(host_key->n, &clen); |
sum_len += clen; |
sum_len += clen; |
|
|
|
rbits = BN_num_bits(host_key->n); |
|
if (bits != rbits) { |
|
log("Warning: Server lies about size of server host key,"); |
|
log("Warning: this may be due to an old implementation of ssh."); |
|
log("Warning: (actual size %d bits, announced size %d bits)", rbits, bits); |
|
} |
|
|
/* Store the host key from the known host file in here |
/* Store the host key from the known host file in here |
* so that we can compare it with the key for the IP |
* so that we can compare it with the key for the IP |