aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlloyd <[email protected]>2009-08-27 23:59:33 +0000
committerlloyd <[email protected]>2009-08-27 23:59:33 +0000
commit83736f3f47b62c6848bde912753218acab2a1742 (patch)
tree81ff665696887276217ba312f41872d78f5e4f2c
parente760bf5a77b9439b268c9dbccd4b88b0a9350039 (diff)
Thomas Moschny mentioned that OpenSSL 1.0 betas disable MD2 by default.
Wrap the EVP_ calls in OPENSSL_NO_XXX checks to handle this.
-rw-r--r--src/engine/openssl/ossl_md.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/engine/openssl/ossl_md.cpp b/src/engine/openssl/ossl_md.cpp
index 08672cfc8..7c8fb678c 100644
--- a/src/engine/openssl/ossl_md.cpp
+++ b/src/engine/openssl/ossl_md.cpp
@@ -95,20 +95,30 @@ EVP_HashFunction::~EVP_HashFunction()
HashFunction* OpenSSL_Engine::find_hash(const SCAN_Name& request,
Algorithm_Factory&) const
{
+#ifndef OPENSSL_NO_SHA
if(request.algo_name() == "SHA-160")
return new EVP_HashFunction(EVP_sha1(), "SHA-160");
+#endif
+#ifndef OPENSSL_NO_MD2
if(request.algo_name() == "MD2")
return new EVP_HashFunction(EVP_md2(), "MD2");
+#endif
+#ifndef OPENSSL_NO_MD4
if(request.algo_name() == "MD4")
return new EVP_HashFunction(EVP_md4(), "MD4");
+#endif
+#ifndef OPENSSL_NO_MD5
if(request.algo_name() == "MD5")
return new EVP_HashFunction(EVP_md5(), "MD5");
+#endif
+#ifndef OPENSSL_NO_RIPEMD
if(request.algo_name() == "RIPEMD-160")
return new EVP_HashFunction(EVP_ripemd160(), "RIPEMD-160");
+#endif
return 0;
}