aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelen <jjelen@redhat.com>2019-10-02 16:35:13 +0200
committerJakub Jelen <jjelen@redhat.com>2019-10-25 13:42:07 +0200
commit5a0177def02d3810bc2745aa41d084ac5bdab1cd (patch)
tree8967e57607fdbc7e3accd5539c987c5071fc8c15
parent17952c495380e128ea418bf4955fa1ed8f6ef994 (diff)
downloadlibssh-5a0177def02d3810bc2745aa41d084ac5bdab1cd.tar.gz
libssh-5a0177def02d3810bc2745aa41d084ac5bdab1cd.tar.xz
libssh-5a0177def02d3810bc2745aa41d084ac5bdab1cd.zip
packet_crypt: Avoid out of bounds access in debug functions
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
-rw-r--r--src/packet_crypt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/packet_crypt.c b/src/packet_crypt.c
index e31ab432..727e4d4d 100644
--- a/src/packet_crypt.c
+++ b/src/packet_crypt.c
@@ -196,9 +196,9 @@ unsigned char *ssh_packet_encrypt(ssh_session session, void *data, uint32_t len)
hmac_final(ctx, crypto->hmacbuf, &finallen);
}
#ifdef DEBUG_CRYPTO
- ssh_log_hexdump("mac: ",data,hmac_digest_len(type));
+ ssh_log_hexdump("mac: ", data, len);
if (finallen != hmac_digest_len(type)) {
- printf("Final len is %d\n",finallen);
+ printf("Final len is %d\n", finallen);
}
ssh_log_hexdump("Packet hmac", crypto->hmacbuf, hmac_digest_len(type));
#endif