diff options
author | lloyd <[email protected]> | 2008-11-11 21:53:39 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-11-11 21:53:39 +0000 |
commit | 8b5b9aa24741622c2010f6a03238891025058382 (patch) | |
tree | c0fb9e252cad2c317ff760cf8158516452a2f126 /src | |
parent | 80c0504a2e60061f8a0424fdf697d3c8429af918 (diff) |
Remove some uses of lookup.h from CMS code
Diffstat (limited to 'src')
-rw-r--r-- | src/cms/cms_dalg.cpp | 8 | ||||
-rw-r--r-- | src/cms/cms_ealg.cpp | 5 |
2 files changed, 9 insertions, 4 deletions
diff --git a/src/cms/cms_dalg.cpp b/src/cms/cms_dalg.cpp index cd38c596d..501ea7873 100644 --- a/src/cms/cms_dalg.cpp +++ b/src/cms/cms_dalg.cpp @@ -7,9 +7,10 @@ #include <botan/x509find.h> #include <botan/ber_dec.h> #include <botan/oids.h> -#include <botan/lookup.h> +#include <botan/hash.h> #include <botan/look_pk.h> #include <botan/bigint.h> +#include <botan/libstate.h> #include <memory> namespace Botan { @@ -24,7 +25,10 @@ SecureVector<byte> hash_of(const SecureVector<byte>& content, std::string& hash_name) { hash_name = OIDS::lookup(hash_algo.oid); - std::auto_ptr<HashFunction> hash_fn(get_hash(hash_name)); + + Algorithm_Factory& af = global_state().algorithm_factory(); + + std::auto_ptr<HashFunction> hash_fn(af.make_hash_function(hash_name)); return hash_fn->process(content); } diff --git a/src/cms/cms_ealg.cpp b/src/cms/cms_ealg.cpp index 32de548b8..36641753b 100644 --- a/src/cms/cms_ealg.cpp +++ b/src/cms/cms_ealg.cpp @@ -52,9 +52,10 @@ DER_Encoder& encode_si(DER_Encoder& der, const X509_Certificate& cert, * Compute the hash of some content * *************************************************/ SecureVector<byte> hash_of(const SecureVector<byte>& content, - const std::string& hash) + const std::string& hash_name) { - std::auto_ptr<HashFunction> hash_fn(get_hash(hash)); + Algorithm_Factory& af = global_state().algorithm_factory(); + std::auto_ptr<HashFunction> hash_fn(af.make_hash_function(hash_name)); return hash_fn->process(content); } |