From: Remi Gacogne Date: Wed, 23 Jun 2021 16:00:25 +0000 (+0200) Subject: Credentials: Fix compilation without OpenSSL 1.1.1 X-Git-Tag: dnsdist-1.7.0-alpha1~12^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b59e67122a00f395fcb1be1b2c62eaacf1dcca4c;p=thirdparty%2Fpdns.git Credentials: Fix compilation without OpenSSL 1.1.1 --- diff --git a/pdns/credentials.cc b/pdns/credentials.cc index 1d392322bd..2cefba2a17 100644 --- a/pdns/credentials.cc +++ b/pdns/credentials.cc @@ -87,9 +87,9 @@ void SensitiveData::clear() d_data.clear(); } -#ifdef HAVE_EVP_PKEY_CTX_SET1_SCRYPT_SALT static std::string hashPasswordInternal(const std::string& password, const std::string& salt, uint64_t workFactor, uint64_t parallelFactor, uint64_t blockSize) { +#ifdef HAVE_EVP_PKEY_CTX_SET1_SCRYPT_SALT auto pctx = std::unique_ptr(EVP_PKEY_CTX_new_id(EVP_PKEY_SCRYPT, nullptr), EVP_PKEY_CTX_free); if (!pctx) { throw std::runtime_error("Error getting a scrypt context to hash the supplied password"); @@ -128,8 +128,10 @@ static std::string hashPasswordInternal(const std::string& password, const std:: } return out; -} +#else + throw std::runtime_error("Hashing support is not available"); #endif +} static std::string generateRandomSalt() {