diff options
Diffstat (limited to 'src/lib/mac')
-rw-r--r-- | src/lib/mac/cbc_mac/cbc_mac.cpp | 5 | ||||
-rw-r--r-- | src/lib/mac/cmac/cmac.cpp | 5 | ||||
-rw-r--r-- | src/lib/mac/hmac/hmac.cpp | 5 | ||||
-rw-r--r-- | src/lib/mac/x919_mac/x919_mac.cpp | 3 |
4 files changed, 13 insertions, 5 deletions
diff --git a/src/lib/mac/cbc_mac/cbc_mac.cpp b/src/lib/mac/cbc_mac/cbc_mac.cpp index d893b922f..f07c7fe37 100644 --- a/src/lib/mac/cbc_mac/cbc_mac.cpp +++ b/src/lib/mac/cbc_mac/cbc_mac.cpp @@ -13,7 +13,10 @@ namespace Botan { CBC_MAC* CBC_MAC::make(const Spec& spec) { if(spec.arg_count() == 1) - return new CBC_MAC(Algo_Registry<BlockCipher>::global_registry().make(spec.arg(0))); + { + if(auto bc = make_block_cipher(spec.arg(0))) + return new CBC_MAC(bc.release()); + } return nullptr; } diff --git a/src/lib/mac/cmac/cmac.cpp b/src/lib/mac/cmac/cmac.cpp index a77673138..0b867af8f 100644 --- a/src/lib/mac/cmac/cmac.cpp +++ b/src/lib/mac/cmac/cmac.cpp @@ -13,7 +13,10 @@ namespace Botan { CMAC* CMAC::make(const Spec& spec) { if(spec.arg_count() == 1) - return new CMAC(Algo_Registry<BlockCipher>::global_registry().make(spec.arg(0))); + { + if(BlockCipher* bc = get_block_cipher(spec.arg(0))) + return new CMAC(bc); + } return nullptr; } diff --git a/src/lib/mac/hmac/hmac.cpp b/src/lib/mac/hmac/hmac.cpp index 12525f088..1c6821a54 100644 --- a/src/lib/mac/hmac/hmac.cpp +++ b/src/lib/mac/hmac/hmac.cpp @@ -14,7 +14,10 @@ namespace Botan { HMAC* HMAC::make(const Spec& spec) { if(spec.arg_count() == 1) - return new HMAC(Algo_Registry<HashFunction>::global_registry().make(spec.arg(0))); + { + if(HashFunction* h = get_hash_function(spec.arg(0))) + return new HMAC(h); + } return nullptr; } diff --git a/src/lib/mac/x919_mac/x919_mac.cpp b/src/lib/mac/x919_mac/x919_mac.cpp index 31fda319b..2e0fb2817 100644 --- a/src/lib/mac/x919_mac/x919_mac.cpp +++ b/src/lib/mac/x919_mac/x919_mac.cpp @@ -90,8 +90,7 @@ MessageAuthenticationCode* ANSI_X919_MAC::clone() const */ ANSI_X919_MAC::ANSI_X919_MAC() : m_state(8), m_position(0) { - auto& ciphers = Algo_Registry<BlockCipher>::global_registry(); - m_des1.reset(ciphers.make(BlockCipher::Spec("DES"), "")); + m_des1.reset(get_block_cipher("DES")); m_des2.reset(m_des1->clone()); } |