mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-11-30 13:01:23 +03:00
packet_crypt: Check return values from AEAD deciphering
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
@@ -60,7 +60,7 @@ uint32_t ssh_packet_decrypt_len(ssh_session session,
|
|||||||
crypto = ssh_packet_get_current_crypto(session, SSH_DIRECTION_IN);
|
crypto = ssh_packet_get_current_crypto(session, SSH_DIRECTION_IN);
|
||||||
if (crypto != NULL) {
|
if (crypto != NULL) {
|
||||||
if (crypto->in_cipher->aead_decrypt_length != NULL) {
|
if (crypto->in_cipher->aead_decrypt_length != NULL) {
|
||||||
crypto->in_cipher->aead_decrypt_length(
|
rc = crypto->in_cipher->aead_decrypt_length(
|
||||||
crypto->in_cipher, source, destination,
|
crypto->in_cipher, source, destination,
|
||||||
crypto->in_cipher->lenfield_blocksize,
|
crypto->in_cipher->lenfield_blocksize,
|
||||||
session->recv_seq);
|
session->recv_seq);
|
||||||
@@ -71,9 +71,9 @@ uint32_t ssh_packet_decrypt_len(ssh_session session,
|
|||||||
source,
|
source,
|
||||||
0,
|
0,
|
||||||
crypto->in_cipher->blocksize);
|
crypto->in_cipher->blocksize);
|
||||||
if (rc < 0) {
|
}
|
||||||
return 0;
|
if (rc < 0) {
|
||||||
}
|
return 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
memcpy(destination, source, 8);
|
memcpy(destination, source, 8);
|
||||||
|
|||||||
Reference in New Issue
Block a user