aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/pk_pad/emsa_pkcs1
diff options
context:
space:
mode:
authorlloyd <[email protected]>2015-03-04 04:30:20 +0000
committerlloyd <[email protected]>2015-03-04 04:30:20 +0000
commit2591a2cd863696b91128ff4a8461bb96d497e7b4 (patch)
treeacb7a179a0790ec63c0c21ecb2ea9d7939e05248 /src/lib/pk_pad/emsa_pkcs1
parentc794f78bd9b7eebc58c39fd00de90b26fb4cfb67 (diff)
Hide Algorithm_Factory and use the functions in lookup.h internally.
Fix two memory leaks (in TLS and modes) caused by calling get_foo and then cloning the result before saving it (leaking the original object), a holdover from the conversion between construction techniques in 1.11.14
Diffstat (limited to 'src/lib/pk_pad/emsa_pkcs1')
-rw-r--r--src/lib/pk_pad/emsa_pkcs1/emsa_pkcs1.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/pk_pad/emsa_pkcs1/emsa_pkcs1.cpp b/src/lib/pk_pad/emsa_pkcs1/emsa_pkcs1.cpp
index 8f6255b23..f73c8b7d9 100644
--- a/src/lib/pk_pad/emsa_pkcs1/emsa_pkcs1.cpp
+++ b/src/lib/pk_pad/emsa_pkcs1/emsa_pkcs1.cpp
@@ -17,7 +17,11 @@ EMSA* make_pkcs1v15(const EMSA::Spec& spec)
if(spec.arg(0) == "Raw")
return new EMSA_PKCS1v15_Raw;
else
- return new EMSA_PKCS1v15(make_a<HashFunction>(spec.arg(0)));
+ {
+ if(HashFunction* h = get_hash_function(spec.arg(0)))
+ return new EMSA_PKCS1v15(h);
+ }
+ return nullptr;
}
}