aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Weber <[email protected]>2016-05-30 12:58:41 +0200
committerPhilipp Weber <[email protected]>2016-05-30 12:58:41 +0200
commit88ed5a6ed0c3c5c63e768d076253ecb77df2b338 (patch)
treed1ced435d2bf2850f86ca09bdab4e348d26b8efa
parent5716a2556a8ff66f6eff7d28659bebdb1e8aedc1 (diff)
ecies: fix tests for ecies-iso (allow empty ciphertext)
-rw-r--r--src/tests/test_ecies.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/tests/test_ecies.cpp b/src/tests/test_ecies.cpp
index a4a669db8..ef7506daa 100644
--- a/src/tests/test_ecies.cpp
+++ b/src/tests/test_ecies.cpp
@@ -71,7 +71,10 @@ void check_encrypt_decrypt(Test::Result& result, const Botan::ECDH_PrivateKey& p
try
{
const std::vector<byte> encrypted = ecies_enc.encrypt(plaintext, Test::rng());
- result.test_eq("encrypted data", encrypted, ciphertext);
+ if(!ciphertext.empty())
+ {
+ result.test_eq("encrypted data", encrypted, ciphertext);
+ }
const Botan::secure_vector<byte> decrypted = ecies_dec.decrypt(encrypted);
result.test_eq("decrypted data equals plaintext", decrypted, plaintext);
@@ -93,9 +96,9 @@ void check_encrypt_decrypt(Test::Result& result, const Botan::ECDH_PrivateKey& p
const Botan::ECDH_PrivateKey& other_private_key,
const Botan::ECIES_System_Params& ecies_params, size_t iv_length = 0)
{
- const std::vector<byte> Plaintext { 1, 2, 3 };
+ const std::vector<byte> plaintext { 1, 2, 3 };
check_encrypt_decrypt(result, private_key, other_private_key, ecies_params, std::vector<byte>(iv_length, 0), "",
- Plaintext, std::vector<byte>());
+ plaintext, std::vector<byte>());
}
class ECIES_ISO_Tests : public Text_Based_Test