]> git.ipfire.org Git - thirdparty/pdns.git/blobdiff - pdns/digests.hh
Detect {Libre,Open}SSL functions availability during configure
[thirdparty/pdns.git] / pdns / digests.hh
index 8e32acc2d706f2c6e6976b0c16e7d05a90bb0c68..0f30ba8306ac1376cd3becb14c524f2a1e820159 100644 (file)
 
 inline std::string pdns_hash(const EVP_MD * md, const std::string& input)
 {
-#if OPENSSL_VERSION_NUMBER < 0x1010000fL
-  auto mdctx = std::unique_ptr<EVP_MD_CTX, void(*)(EVP_MD_CTX*)>(EVP_MD_CTX_create(), EVP_MD_CTX_destroy);
-#else
+#if defined(HAVE_EVP_MD_CTX_NEW) && defined(HAVE_EVP_MD_CTX_FREE)
   auto mdctx = std::unique_ptr<EVP_MD_CTX, void(*)(EVP_MD_CTX*)>(EVP_MD_CTX_new(), EVP_MD_CTX_free);
+#else
+  auto mdctx = std::unique_ptr<EVP_MD_CTX, void(*)(EVP_MD_CTX*)>(EVP_MD_CTX_create(), EVP_MD_CTX_destroy);
 #endif
   if (!mdctx) {
     throw std::runtime_error(std::string(EVP_MD_name(md)) + " context initialization failed");