diff options
author | lloyd <[email protected]> | 2015-03-04 04:30:20 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2015-03-04 04:30:20 +0000 |
commit | 2591a2cd863696b91128ff4a8461bb96d497e7b4 (patch) | |
tree | acb7a179a0790ec63c0c21ecb2ea9d7939e05248 /src/lib/pubkey | |
parent | c794f78bd9b7eebc58c39fd00de90b26fb4cfb67 (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/pubkey')
-rw-r--r-- | src/lib/pubkey/rfc6979/rfc6979.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/lib/pubkey/rfc6979/rfc6979.cpp b/src/lib/pubkey/rfc6979/rfc6979.cpp index 9f9bbc9c0..3bd723d6d 100644 --- a/src/lib/pubkey/rfc6979/rfc6979.cpp +++ b/src/lib/pubkey/rfc6979/rfc6979.cpp @@ -8,7 +8,7 @@ #include <botan/rfc6979.h> #include <botan/hmac_drbg.h> #include <botan/scan_name.h> -#include <botan/internal/algo_registry.h> +#include <botan/lookup.h> namespace Botan { @@ -30,8 +30,7 @@ BigInt generate_rfc6979_nonce(const BigInt& x, const BigInt& h, const std::string& hash) { - auto& macs = Algo_Registry<MessageAuthenticationCode>::global_registry(); - HMAC_DRBG rng(macs.make("HMAC(" + hash + ")"), nullptr); + HMAC_DRBG rng(make_message_auth("HMAC(" + hash + ")").release(), nullptr); const size_t qlen = q.bits(); const size_t rlen = qlen / 8 + (qlen % 8 ? 1 : 0); |