From 2591a2cd863696b91128ff4a8461bb96d497e7b4 Mon Sep 17 00:00:00 2001 From: lloyd Date: Wed, 4 Mar 2015 04:30:20 +0000 Subject: 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 --- src/lib/kdf/prf_tls/prf_tls.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/lib/kdf/prf_tls') 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(spec.arg(0))) + if(auto mac = get_mac(spec.arg(0))) return new TLS_12_PRF(mac); - if(auto hash = make_a(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("HMAC(MD5)")); - m_hmac_sha1.reset(make_a("HMAC(SHA-1)")); } namespace { -- cgit v1.2.3