From 696a417126d7be2052f6249d88df2c41d8b90d7d Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Fri, 5 Nov 2021 10:17:42 +0100 Subject: [PATCH] cast arg of EVP_PKEY_CTX_set1_pbe_pass() to const void * to satisfy both openssl 1.1 and 3.0 --- pdns/credentials.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pdns/credentials.cc b/pdns/credentials.cc index f7d3417edb..b3a09e5c81 100644 --- a/pdns/credentials.cc +++ b/pdns/credentials.cc @@ -105,7 +105,8 @@ static std::string hashPasswordInternal(const std::string& password, const std:: throw std::runtime_error("Error intializing the scrypt context to hash the supplied password"); } - if (EVP_PKEY_CTX_set1_pbe_pass(pctx.get(), reinterpret_cast(password.data()), password.size()) <= 0) { + // OpenSSL 3.0 changed the string arg to const unsigned char*, other versions use const char *, so cast to const void * to satisfy both + if (EVP_PKEY_CTX_set1_pbe_pass(pctx.get(), reinterpret_cast(password.data()), password.size()) <= 0) { throw std::runtime_error("Error adding the password to the scrypt context to hash the supplied password"); } -- 2.47.2