aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/kdf/prf_tls
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/kdf/prf_tls
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/kdf/prf_tls')
-rw-r--r--src/lib/kdf/prf_tls/prf_tls.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/kdf/prf_tls/prf_tls.cpp b/src/lib/kdf/prf_tls/prf_tls.cpp
index 9161dc71e..2deb133e9 100644
--- a/src/lib/kdf/prf_tls/prf_tls.cpp
+++ b/src/lib/kdf/prf_tls/prf_tls.cpp
@@ -13,9 +13,9 @@ namespace Botan {
TLS_12_PRF* TLS_12_PRF::make(const Spec& spec)
{
- if(auto mac = make_a<MessageAuthenticationCode>(spec.arg(0)))
+ if(auto mac = get_mac(spec.arg(0)))
return new TLS_12_PRF(mac);
- if(auto hash = make_a<HashFunction>(spec.arg(0)))
+ if(auto hash = get_hash_function(spec.arg(0)))
return new TLS_12_PRF(new HMAC(hash));
return nullptr;
}
@@ -23,10 +23,10 @@ TLS_12_PRF* TLS_12_PRF::make(const Spec& spec)
BOTAN_REGISTER_NAMED_T(KDF, "TLS-12-PRF", TLS_12_PRF, TLS_12_PRF::make);
BOTAN_REGISTER_KDF_NOARGS(TLS_PRF, "TLS-PRF");
-TLS_PRF::TLS_PRF()
+TLS_PRF::TLS_PRF() :
+ m_hmac_md5(make_message_auth("HMAC(MD5)")),
+ m_hmac_sha1(make_message_auth("HMAC(SHA-1)"))
{
- m_hmac_md5.reset(make_a<MessageAuthenticationCode>("HMAC(MD5)"));
- m_hmac_sha1.reset(make_a<MessageAuthenticationCode>("HMAC(SHA-1)"));
}
namespace {