1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-05-31 16:21:13 +03:00

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 <jon@jonsimons.org>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Jon Simons 2018-06-08 18:32:32 -04:00 committed by Andreas Schneider
parent d4a4ce4d44
commit c8d6445d44

View File

@ -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,