aboutsummaryrefslogtreecommitdiff
path: root/src/packet_cb.c
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2015-09-23 22:36:50 +0200
committerAris Adamantiadis <aris@0xbadc0de.be>2015-09-24 16:46:12 +0200
commit06b9901e64f1ea2a1141115e5645552034d25850 (patch)
treeefc2925fbc734c4f90d7bc5ca01c917a14627586 /src/packet_cb.c
parent677fa8ced26fb257285fdc1b0729bc49c189c8ee (diff)
downloadlibssh-06b9901e64f1ea2a1141115e5645552034d25850.tar.gz
libssh-06b9901e64f1ea2a1141115e5645552034d25850.tar.xz
libssh-06b9901e64f1ea2a1141115e5645552034d25850.zip
crypto: move key setup in newkeys handler
Diffstat (limited to 'src/packet_cb.c')
-rw-r--r--src/packet_cb.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/packet_cb.c b/src/packet_cb.c
index 4fe6402a..f2162304 100644
--- a/src/packet_cb.c
+++ b/src/packet_cb.c
@@ -237,6 +237,14 @@ SSH_PACKET_CALLBACK(ssh_packet_newkeys){
}
memcpy(session->next_crypto->session_id, session->current_crypto->session_id,
session->current_crypto->digest_len);
+ if (session->current_crypto->in_cipher->set_decrypt_key(session->current_crypto->in_cipher, session->current_crypto->decryptkey,
+ session->current_crypto->decryptIV) < 0) {
+ goto error;
+ }
+ if (session->current_crypto->out_cipher->set_encrypt_key(session->current_crypto->out_cipher, session->current_crypto->encryptkey,
+ session->current_crypto->encryptIV) < 0) {
+ goto error;
+ }
}
session->dh_handshake_state = DH_STATE_FINISHED;
session->ssh_connection_callback(session);