Test that ciphertexts shorter than the MAC size aren't even read

This commit is contained in:
Frank Denis 2016-04-04 10:47:54 +02:00
parent d73124a025
commit b09e1970bc
2 changed files with 3 additions and 3 deletions

View File

@ -3179,7 +3179,7 @@ tv(void)
printf("Message length should have been set to zero after a failure\n");
}
if (crypto_aead_aes256gcm_decrypt(decrypted, &found_message_len,
NULL, ciphertext,
NULL, NULL,
randombytes_uniform(crypto_aead_aes256gcm_ABYTES),
ad, ad_len, nonce, key) != -1) {
printf("Verification of test vector #%u with a truncated tag failed\n",

View File

@ -111,7 +111,7 @@ tv(void)
}
m2len = 1;
if (crypto_aead_chacha20poly1305_decrypt(
m2, &m2len, NULL, c,
m2, &m2len, NULL, NULL,
randombytes_uniform(crypto_aead_chacha20poly1305_ABYTES),
NULL, 0U, nonce, firstkey) != -1) {
printf("crypto_aead_chacha20poly1305_decrypt() worked with a short "
@ -282,7 +282,7 @@ tv_ietf(void)
}
m2len = 1;
if (crypto_aead_chacha20poly1305_ietf_decrypt(
m2, &m2len, NULL, c,
m2, &m2len, NULL, NULL,
randombytes_uniform(crypto_aead_chacha20poly1305_ietf_ABYTES),
NULL, 0U, nonce, firstkey) != -1) {
printf("crypto_aead_chacha20poly1305_ietf_decrypt() worked with a short "