diff options
author | Jack Lloyd <[email protected]> | 2019-10-13 13:08:16 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2019-10-13 13:08:16 -0400 |
commit | bce33087defad65769f4666c8f1a95013684116a (patch) | |
tree | 48770681c3586122cb521c17a1e3b1648fa4a722 /src/tests/test_ecies.cpp | |
parent | 8dbad8d9f2337f9bd1bb1e9bf7432f74eadad9ee (diff) |
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
Diffstat (limited to 'src/tests/test_ecies.cpp')
-rw-r--r-- | src/tests/test_ecies.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
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<uint8_t> iv = vars.get_req_bin("Iv"); + const std::vector<uint8_t> 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")); |