From 74848abffcf2e5aa56f9bf1928559a387f72bb63 Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Tue, 18 Jan 2022 08:17:28 +0100 Subject: [PATCH] evp_md_ctx_new/free was called evp_md_ctx_create/destroy in OpenSSL < 1.1 --- pdns/sha.hh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pdns/sha.hh b/pdns/sha.hh index bf8cc4eaf9..26c64de9ae 100644 --- a/pdns/sha.hh +++ b/pdns/sha.hh @@ -59,7 +59,11 @@ class SHADigest { public: SHADigest(unsigned int bits) : +#if defined(HAVE_EVP_MD_CTX_NEW) && defined(HAVE_EVP_MD_CTX_FREE) mdctx(std::unique_ptr(EVP_MD_CTX_new(), EVP_MD_CTX_free)) +#else + mdctx(std::unique_ptr(EVP_MD_CTX_create(), EVP_MD_CTX_destroy)) +#endif { if (mdctx == nullptr) { throw std::runtime_error("SHADigest: EVP_MD_CTX_new failed"); @@ -109,7 +113,11 @@ public: } private: +#if defined(HAVE_EVP_MD_CTX_NEW) && defined(HAVE_EVP_MD_CTX_FREE) std::unique_ptr mdctx; +#else + std::unique_ptr mdctx; +#endif const EVP_MD* md; }; } -- 2.47.3