aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-08-10 17:53:14 -0400
committerJack Lloyd <[email protected]>2018-08-10 17:53:14 -0400
commitd39a070103bd734d5ed65d5e70e628a4a3a4a179 (patch)
tree5204f2b62aefca4b3bea5d2f6f7aed3ed1a2780c
parent4a8fabb31998eb3b60b981e4ba37780cfd1eea5a (diff)
Fix FFI test
This could fail if the random plaintext was of zero length
-rw-r--r--src/tests/test_ffi.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/tests/test_ffi.cpp b/src/tests/test_ffi.cpp
index 9739d725c..10a1f8b2d 100644
--- a/src/tests/test_ffi.cpp
+++ b/src/tests/test_ffi.cpp
@@ -2023,12 +2023,14 @@ class FFI_Unit_Tests final : public Test
if(TEST_FFI_OK(botan_mceies_encrypt, (pub, rng, "AES-256/OCB", plaintext.data(), plaintext.size(), ad, ad_len,
ciphertext.data(), &ciphertext_len)))
{
- std::vector<uint8_t> decrypted(plaintext.size());
+ std::vector<uint8_t> decrypted(ciphertext.size());
size_t decrypted_len = plaintext_len;
TEST_FFI_OK(botan_mceies_decrypt, (priv, "AES-256/OCB", ciphertext.data(), ciphertext.size(), ad, ad_len,
decrypted.data(), &decrypted_len));
+ decrypted.resize(decrypted_len);
+
result.test_eq("MCIES plaintext", decrypted, plaintext);
}
#endif