diff options
author | Jakub Jelen <jjelen@redhat.com> | 2019-10-02 16:35:13 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2019-10-25 16:11:17 +0200 |
commit | c888d9c690ed885437dc589cb0a23e21a0540f3c (patch) | |
tree | fb22f54a252b829babf0990c97732258d412c348 | |
parent | 07df7bb4e62dd2f03fe2c16b1d7bd605191ed8fc (diff) | |
download | libssh-c888d9c690ed885437dc589cb0a23e21a0540f3c.tar.gz libssh-c888d9c690ed885437dc589cb0a23e21a0540f3c.tar.xz libssh-c888d9c690ed885437dc589cb0a23e21a0540f3c.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>
(cherry picked from commit 5a0177def02d3810bc2745aa41d084ac5bdab1cd)
-rw-r--r-- | src/packet_crypt.c | 4 |
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 |