Remove OpenSSL 3.0 patch
This commit is contained in:
parent
ecadbd34f3
commit
8f5a9a528e
|
@ -1,38 +0,0 @@
|
||||||
From 1be568979e8ae740026bab44073a5274d43ed9ee Mon Sep 17 00:00:00 2001
|
|
||||||
From: Remi Gacogne <remi.gacogne@powerdns.com>
|
|
||||||
Date: Mon, 17 Jan 2022 16:13:09 +0100
|
|
||||||
Subject: [PATCH] Fix build with OpenSSL 3.0.0
|
|
||||||
|
|
||||||
(cherry picked from commit 8535f66672ec9d1eebf5835d3e53238973a80478)
|
|
||||||
---
|
|
||||||
pdns/credentials.cc | 10 ++++++++--
|
|
||||||
1 file changed, 8 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/pdns/credentials.cc b/pdns/credentials.cc
|
|
||||||
index b3a09e5c819..d058a948ac1 100644
|
|
||||||
--- a/pdns/credentials.cc
|
|
||||||
+++ b/pdns/credentials.cc
|
|
||||||
@@ -31,6 +31,7 @@
|
|
||||||
#ifdef HAVE_EVP_PKEY_CTX_SET1_SCRYPT_SALT
|
|
||||||
#include <openssl/evp.h>
|
|
||||||
#include <openssl/kdf.h>
|
|
||||||
+#include <openssl/opensslv.h>
|
|
||||||
#include <openssl/rand.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
@@ -105,8 +106,13 @@ static std::string hashPasswordInternal(const std::string& password, const std::
|
|
||||||
throw std::runtime_error("Error intializing the scrypt context to hash the supplied password");
|
|
||||||
}
|
|
||||||
|
|
||||||
- // 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<const void*>(password.data()), password.size()) <= 0) {
|
|
||||||
+ // OpenSSL 3.0 changed the string arg to const unsigned char*, other versions use const char *
|
|
||||||
+#if OPENSSL_VERSION_MAJOR >= 3
|
|
||||||
+ auto passwordData = reinterpret_cast<const char*>(password.data());
|
|
||||||
+#else
|
|
||||||
+ auto passwordData = reinterpret_cast<const unsigned char*>(password.data());
|
|
||||||
+#endif
|
|
||||||
+ if (EVP_PKEY_CTX_set1_pbe_pass(pctx.get(), passwordData, password.size()) <= 0) {
|
|
||||||
throw std::runtime_error("Error adding the password to the scrypt context to hash the supplied password");
|
|
||||||
}
|
|
||||||
|
|
|
@ -9,7 +9,6 @@ License: GPLv2
|
||||||
URL: http://powerdns.com
|
URL: http://powerdns.com
|
||||||
Source0: http://downloads.powerdns.com/releases/%{name}-%{version}.tar.bz2
|
Source0: http://downloads.powerdns.com/releases/%{name}-%{version}.tar.bz2
|
||||||
Patch0: pdns-disable-secpoll.patch
|
Patch0: pdns-disable-secpoll.patch
|
||||||
# Patch1: pdns-openssl.patch
|
|
||||||
ExcludeArch: %{arm} %{ix86}
|
ExcludeArch: %{arm} %{ix86}
|
||||||
|
|
||||||
Requires(pre): shadow-utils
|
Requires(pre): shadow-utils
|
||||||
|
@ -140,7 +139,7 @@ BuildRequires: yaml-cpp-devel
|
||||||
This package contains the ixfrdist program.
|
This package contains the ixfrdist program.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -p1
|
%autosetup
|
||||||
|
|
||||||
%build
|
%build
|
||||||
export CPPFLAGS="-DLDAP_DEPRECATED"
|
export CPPFLAGS="-DLDAP_DEPRECATED"
|
||||||
|
|
Loading…
Reference in New Issue