const struct ssh_mac *csmac, *scmac;
const struct ssh_compress *cscomp, *sccomp;
const struct ssh_kex *kex;
const struct ssh_mac *csmac, *scmac;
const struct ssh_compress *cscomp, *sccomp;
const struct ssh_kex *kex;
st->realcrc = crc32(ssh->pktin.data, st->biglen - 4);
st->gotcrc = GET_32BIT(ssh->pktin.data + st->biglen - 4);
st->realcrc = crc32(ssh->pktin.data, st->biglen - 4);
st->gotcrc = GET_32BIT(ssh->pktin.data + st->biglen - 4);
- ssh->sccipher->decrypt(ssh->pktin.data, st->cipherblk);
+ ssh->sccipher->decrypt(ssh->sc_cipher_ctx,
+ ssh->pktin.data, st->cipherblk);
- ssh->sccipher->decrypt(ssh->pktin.data + st->cipherblk,
+ ssh->sccipher->decrypt(ssh->sc_cipher_ctx,
+ ssh->pktin.data + st->cipherblk,
- ssh->cscipher->encrypt(ssh->pktout.data, ssh->pktout.length + padding);
+ ssh->cscipher->encrypt(ssh->cs_cipher_ctx,
+ ssh->pktout.data, ssh->pktout.length + padding);
/* Ready-to-send packet starts at ssh->pktout.data. We return length. */
return ssh->pktout.length + padding + maclen;
/* Ready-to-send packet starts at ssh->pktout.data. We return length. */
return ssh->pktout.length + padding + maclen;
ssh->cipher = (s->cipher_type == SSH_CIPHER_BLOWFISH ? &ssh_blowfish_ssh1 :
s->cipher_type == SSH_CIPHER_DES ? &ssh_des :
&ssh_3des);
ssh->cipher = (s->cipher_type == SSH_CIPHER_BLOWFISH ? &ssh_blowfish_ssh1 :
s->cipher_type == SSH_CIPHER_DES ? &ssh_des :
&ssh_3des);
- ssh->cipher->sesskey(ssh->session_key);
+ ssh->v1_cipher_ctx = ssh->cipher->make_context();
+ ssh->cipher->sesskey(ssh->v1_cipher_ctx, ssh->session_key);
+ {
+ char buf[256];
+ sprintf(buf, "Initialised %.200s encryption", ssh->cipher->text_name);
+ logevent(buf);
+ }
ssh->csmac = s->csmac_tobe;
ssh->scmac = s->scmac_tobe;
ssh->cscomp = s->cscomp_tobe;
ssh->csmac = s->csmac_tobe;
ssh->scmac = s->scmac_tobe;
ssh->cscomp = s->cscomp_tobe;
memcpy(ssh->v2_session_id, s->exchange_hash,
sizeof(s->exchange_hash));
ssh2_mkkey(ssh,s->K,s->exchange_hash,ssh->v2_session_id,'C',keyspace);
memcpy(ssh->v2_session_id, s->exchange_hash,
sizeof(s->exchange_hash));
ssh2_mkkey(ssh,s->K,s->exchange_hash,ssh->v2_session_id,'C',keyspace);
ssh2_mkkey(ssh,s->K,s->exchange_hash,ssh->v2_session_id,'D',keyspace);
ssh2_mkkey(ssh,s->K,s->exchange_hash,ssh->v2_session_id,'D',keyspace);
ssh2_mkkey(ssh,s->K,s->exchange_hash,ssh->v2_session_id,'A',keyspace);
ssh2_mkkey(ssh,s->K,s->exchange_hash,ssh->v2_session_id,'A',keyspace);
ssh2_mkkey(ssh,s->K,s->exchange_hash,ssh->v2_session_id,'B',keyspace);
ssh2_mkkey(ssh,s->K,s->exchange_hash,ssh->v2_session_id,'B',keyspace);
ssh2_mkkey(ssh,s->K,s->exchange_hash,ssh->v2_session_id,'E',keyspace);
ssh->csmac->setcskey(keyspace);
ssh2_mkkey(ssh,s->K,s->exchange_hash,ssh->v2_session_id,'F',keyspace);
ssh->scmac->setsckey(keyspace);
}
ssh2_mkkey(ssh,s->K,s->exchange_hash,ssh->v2_session_id,'E',keyspace);
ssh->csmac->setcskey(keyspace);
ssh2_mkkey(ssh,s->K,s->exchange_hash,ssh->v2_session_id,'F',keyspace);
ssh->scmac->setsckey(keyspace);
}
+ {
+ char buf[256];
+ sprintf(buf, "Initialised %.200s client->server encryption",
+ ssh->cscipher->text_name);
+ logevent(buf);
+ sprintf(buf, "Initialised %.200s server->client encryption",
+ ssh->sccipher->text_name);
+ logevent(buf);
+ }
+