From c8d6445d44f239b6dc2c9261dc796bf06c800ec1 Mon Sep 17 00:00:00 2001 From: Jon Simons Date: Fri, 8 Jun 2018 18:32:32 -0400 Subject: packet_crypt: remove `set_decrypt_key` upon `ssh_packet_decrypt_len` In 06b9901e64f1ea2a1141115e5645552034d25850, invocations of `set_decrypt_key` and `set_encrypt_key` were moved into the `ssh_packet_newkeys` callback, away from the packet decrypt and encrypt functions. Remove the extra `set_decrypt_key` for the case that an `aead_decrypt_length` is not NULL. At this time, only the chacha20-poly1305@openssh.com cipher is affected by this change. Signed-off-by: Jon Simons Reviewed-by: Andreas Schneider --- src/packet_crypt.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/packet_crypt.c b/src/packet_crypt.c index 57be946f..b2f075c4 100644 --- a/src/packet_crypt.c +++ b/src/packet_crypt.c @@ -58,14 +58,6 @@ uint32_t ssh_packet_decrypt_len(ssh_session session, if (session->current_crypto != NULL) { if (session->current_crypto->in_cipher->aead_decrypt_length != NULL) { - rc = - session->current_crypto->in_cipher->set_decrypt_key( - session->current_crypto->in_cipher, - session->current_crypto->decryptkey, - session->current_crypto->decryptIV); - if (rc < 0) { - return (uint32_t)-1; - } session->current_crypto->in_cipher->aead_decrypt_length( session->current_crypto->in_cipher, source, destination, session->current_crypto->in_cipher->lenfield_blocksize, -- cgit v1.2.3