From bce33087defad65769f4666c8f1a95013684116a Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Sun, 13 Oct 2019 13:08:16 -0400 Subject: Always try to use an IV with ECIES If the mode requires an IV, and the user did not set an IV with set_initialization_vector, then previously some hard to understand errors would occur. GH #2150 --- src/tests/test_ecies.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/tests/test_ecies.cpp') diff --git a/src/tests/test_ecies.cpp b/src/tests/test_ecies.cpp index 534a2719e..97f6d2606 100644 --- a/src/tests/test_ecies.cpp +++ b/src/tests/test_ecies.cpp @@ -196,8 +196,9 @@ class ECIES_Tests final : public Text_Based_Test ECIES_Tests() : Text_Based_Test( "pubkey/ecies.vec", - "Curve,PrivateKey,OtherPrivateKey,Kdf,Dem,DemKeyLen,Iv,Mac,MacKeyLen,Format," - "CofactorMode,OldCofactorMode,CheckMode,SingleHashMode,Label,Plaintext,Ciphertext") {} + "Curve,PrivateKey,OtherPrivateKey,Kdf,Dem,DemKeyLen,Mac,MacKeyLen,Format," + "CofactorMode,OldCofactorMode,CheckMode,SingleHashMode,Label,Plaintext,Ciphertext", + "Iv") {} Test::Result run_one_test(const std::string&, const VarMap& vars) override { @@ -209,7 +210,7 @@ class ECIES_Tests final : public Text_Based_Test const std::string kdf = vars.get_req_str("Kdf"); const std::string dem = vars.get_req_str("Dem"); const size_t dem_key_len = vars.get_req_sz("DemKeyLen"); - const std::vector iv = vars.get_req_bin("Iv"); + const std::vector iv = vars.get_opt_bin("Iv"); const std::string mac = vars.get_req_str("Mac"); const size_t mac_key_len = vars.get_req_sz("MacKeyLen"); const Botan::PointGFp::Compression_Type compression_type = get_compression_type(vars.get_req_str("Format")); -- cgit v1.2.3