From ff615b270ae880a32bc7c519fc364cc5aff1274b Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Thu, 13 Jul 2017 21:40:57 +0200 Subject: [PATCH] Fix the AES test on error path --- test/default/aead_aes256gcm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/default/aead_aes256gcm.c b/test/default/aead_aes256gcm.c index 3338c5fd..cc1ba3f5 100644 --- a/test/default/aead_aes256gcm.c +++ b/test/default/aead_aes256gcm.c @@ -3145,8 +3145,8 @@ tv(void) memcmp(mac, expected_ciphertext + message_len, crypto_aead_aes256gcm_ABYTES) != 0) { printf("Detached encryption of test vector #%u failed\n", (unsigned int) i); - hex = (char *) sodium_malloc((size_t) found_ciphertext_len * 2 + 1); - sodium_bin2hex(hex, (size_t) found_ciphertext_len * 2 + 1, + hex = (char *) sodium_malloc((size_t) ciphertext_len * 2 + 1); + sodium_bin2hex(hex, (size_t) ciphertext_len * 2 + 1, ciphertext, ciphertext_len); printf("Computed: [%s]\n", hex); sodium_free(hex);