From: Otto Moerbeek Date: Tue, 18 Jan 2022 07:17:28 +0000 (+0100) Subject: evp_md_ctx_new/free was called evp_md_ctx_create/destroy in OpenSSL < 1.1 X-Git-Tag: auth-4.7.0-alpha1~59^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=74848abffcf2e5aa56f9bf1928559a387f72bb63;p=thirdparty%2Fpdns.git evp_md_ctx_new/free was called evp_md_ctx_create/destroy in OpenSSL < 1.1 --- 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; }; }