aboutsummaryrefslogtreecommitdiffstats
path: root/checks/pk.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-11-11 00:20:31 +0000
committerlloyd <[email protected]>2008-11-11 00:20:31 +0000
commitfc3322b12b0494c9d3353e416d0408f746d9c797 (patch)
treef1fc5ad8c7b4ea602dc977dd170d01a9c0e56f74 /checks/pk.cpp
parent9df94deaaf1ef36a002e1e9693fc0283a4e2d50c (diff)
Fix segfault due to shared objects in DLIES test
Diffstat (limited to 'checks/pk.cpp')
-rw-r--r--checks/pk.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/checks/pk.cpp b/checks/pk.cpp
index ab6fab665..a353f7ca7 100644
--- a/checks/pk.cpp
+++ b/checks/pk.cpp
@@ -543,12 +543,19 @@ u32bit validate_dlies(const std::string& algo,
if(options.size() != 3)
throw Exception("DLIES needs three options: " + opt_str);
- KDF* kdf = get_kdf(options[0]);
MessageAuthenticationCode* mac = get_mac(options[1]);
u32bit mac_key_len = to_u32bit(options[2]);
- PK_Decryptor* d = new DLIES_Decryptor(to, kdf, mac, mac_key_len);
- DLIES_Encryptor* e = new DLIES_Encryptor(from, kdf, mac, mac_key_len);
+ PK_Decryptor* d =
+ new DLIES_Decryptor(to,
+ get_kdf(options[0]),
+ mac->clone(), mac_key_len);
+
+ DLIES_Encryptor* e =
+ new DLIES_Encryptor(from,
+ get_kdf(options[0]),
+ mac, mac_key_len);
+
e->set_other_key(to.public_value());
std::string empty = "";