aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJakub Jelen <jjelen@redhat.com>2020-01-14 16:49:28 +0100
committerJakub Jelen <jjelen@redhat.com>2020-01-23 09:48:11 +0100
commite31e7b0406f4c2b85831bf7ad90d57d660646108 (patch)
tree802cb8444ee698937444e1990fb666f096069574 /src
parent6644f8ca3babcc37244f69c9bad4124747722c27 (diff)
downloadlibssh-e31e7b0406f4c2b85831bf7ad90d57d660646108.tar.gz
libssh-e31e7b0406f4c2b85831bf7ad90d57d660646108.tar.xz
libssh-e31e7b0406f4c2b85831bf7ad90d57d660646108.zip
packet_crypt: Check return values from AEAD deciphering
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'src')
-rw-r--r--src/packet_crypt.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/packet_crypt.c b/src/packet_crypt.c
index 168fcc72..95d438c8 100644
--- a/src/packet_crypt.c
+++ b/src/packet_crypt.c
@@ -60,7 +60,7 @@ uint32_t ssh_packet_decrypt_len(ssh_session session,
crypto = ssh_packet_get_current_crypto(session, SSH_DIRECTION_IN);
if (crypto != 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->lenfield_blocksize,
session->recv_seq);
@@ -71,9 +71,9 @@ uint32_t ssh_packet_decrypt_len(ssh_session session,
source,
0,
crypto->in_cipher->blocksize);
- if (rc < 0) {
- return 0;
- }
+ }
+ if (rc < 0) {
+ return 0;
}
} else {
memcpy(destination, source, 8);