aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cms/cms_dalg.cpp8
-rw-r--r--src/cms/cms_ealg.cpp5
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);
}