aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstate/engine/def_engine/lookup_mac.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-11-10 21:14:59 +0000
committerlloyd <[email protected]>2008-11-10 21:14:59 +0000
commit04280f4ff97d842a4af15f2e4ea2b87e6095b126 (patch)
treebf56e261ab2ef6b033b7e0761868eb0437e9e12d /src/libstate/engine/def_engine/lookup_mac.cpp
parent13a012955bf68d028ee0cd515e49137b7d95f5e6 (diff)
Move MACs also to Algorithm_Factory
Diffstat (limited to 'src/libstate/engine/def_engine/lookup_mac.cpp')
-rw-r--r--src/libstate/engine/def_engine/lookup_mac.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/libstate/engine/def_engine/lookup_mac.cpp b/src/libstate/engine/def_engine/lookup_mac.cpp
index 5cdc20cf2..7feda835c 100644
--- a/src/libstate/engine/def_engine/lookup_mac.cpp
+++ b/src/libstate/engine/def_engine/lookup_mac.cpp
@@ -4,8 +4,9 @@
*************************************************/
#include <botan/def_eng.h>
-#include <botan/lookup.h>
#include <botan/scan_name.h>
+#include <botan/algo_factory.h>
+#include <botan/lookup.h>
#if defined(BOTAN_HAS_CBC_MAC)
#include <botan/cbc_mac.h>
@@ -33,9 +34,9 @@ namespace Botan {
* Look for an algorithm with this name *
*************************************************/
MessageAuthenticationCode*
-Default_Engine::find_mac(const std::string& algo_spec) const
+Default_Engine::find_mac(const SCAN_Name& request,
+ Algorithm_Factory& af) const
{
- SCAN_Name request(algo_spec);
#if defined(BOTAN_HAS_CBC_MAC)
if(request.algo_name() == "CBC-MAC" && request.arg_count() == 1)
@@ -49,12 +50,12 @@ Default_Engine::find_mac(const std::string& algo_spec) const
#if defined(BOTAN_HAS_HMAC)
if(request.algo_name() == "HMAC" && request.arg_count() == 1)
- return new HMAC(get_hash(request.argument(0)));
+ return new HMAC(af.make_hash_function(request.argument(0)));
#endif
#if defined(BOTAN_HAS_SSL3_MAC)
if(request.algo_name() == "SSL3-MAC" && request.arg_count() == 1)
- return new SSL3_MAC(get_hash(request.argument(0)));
+ return new SSL3_MAC(af.make_hash_function(request.argument(0)));
#endif
#if defined(BOTAN_HAS_ANSI_X919_MAC)