aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/test_aead.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2016-03-23 16:47:33 -0400
committerJack Lloyd <[email protected]>2016-03-23 16:47:33 -0400
commit646ddaef38845a7ce33e4dcc7a02500a674c7033 (patch)
tree7d73e0ac634210ea9cb2f03ec983cd60b9e300d0 /src/tests/test_aead.cpp
parentb971daaade75a6923a4c97b9b40b5fdfe2df4992 (diff)
Fix bug in IETF version of ChaCha20Poly1305
If the input lengths are exact multiples of 16 bytes then no padding should be added. Previously 16 bytes of zero padding were added instead.
Diffstat (limited to 'src/tests/test_aead.cpp')
-rw-r--r--src/tests/test_aead.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/tests/test_aead.cpp b/src/tests/test_aead.cpp
index a31996fad..e7756d5bb 100644
--- a/src/tests/test_aead.cpp
+++ b/src/tests/test_aead.cpp
@@ -1,5 +1,5 @@
/*
-* (C) 2014,2015 Jack Lloyd
+* (C) 2014,2015,2016 Jack Lloyd
*
* Botan is released under the Simplified BSD License (see license.txt)
*/
@@ -54,10 +54,17 @@ class AEAD_Tests : public Text_Based_Test
buf.assign(expected.begin(), expected.end());
- dec->set_key(key);
- dec->set_associated_data_vec(ad);
- dec->start(nonce);
- dec->finish(buf);
+ try
+ {
+ dec->set_key(key);
+ dec->set_associated_data_vec(ad);
+ dec->start(nonce);
+ dec->finish(buf);
+ }
+ catch(Botan::Exception& e)
+ {
+ result.test_failure("Failure processing AEAD ciphertext");
+ }
if(enc->authenticated())
{