mirror of
https://github.com/dashpay/dash.git
synced 2024-12-24 19:42:46 +01:00
revert dash#4683: remove the ability to opt-out from building openssl
This reverts commit b26eaf6954
.
This commit is contained in:
parent
43152b2b35
commit
c7c42fff3d
33
configure.ac
33
configure.ac
@ -246,13 +246,6 @@ AC_ARG_WITH([system-univalue],
|
||||
[system_univalue=$withval],
|
||||
[system_univalue=no]
|
||||
)
|
||||
|
||||
AC_ARG_WITH([openssl],
|
||||
[AS_HELP_STRING([--with-openssl],
|
||||
[enable openssl (default is yes if OpenSSL is found)])],
|
||||
[use_openssl=$withval],
|
||||
[use_openssl=yes])
|
||||
|
||||
AC_ARG_ENABLE([zmq],
|
||||
[AS_HELP_STRING([--disable-zmq],
|
||||
[disable ZMQ notifications])],
|
||||
@ -689,14 +682,12 @@ case $host in
|
||||
dnl It's safe to add these paths even if the functionality is disabled by
|
||||
dnl the user (--without-wallet or --without-gui for example).
|
||||
|
||||
openssl_prefix=`$BREW --prefix openssl 2>/dev/null`
|
||||
bdb_prefix=`$BREW --prefix berkeley-db4 2>/dev/null`
|
||||
qt5_prefix=`$BREW --prefix qt5 2>/dev/null`
|
||||
if test x$use_openssl != xno; then
|
||||
openssl_prefix=`$BREW --prefix openssl 2>/dev/null`
|
||||
if test x$openssl_prefix != x; then
|
||||
PKG_CONFIG_PATH="$openssl_prefix/lib/pkgconfig:$PKG_CONFIG_PATH"
|
||||
export PKG_CONFIG_PATH
|
||||
fi
|
||||
if test x$openssl_prefix != x; then
|
||||
PKG_CONFIG_PATH="$openssl_prefix/lib/pkgconfig:$PKG_CONFIG_PATH"
|
||||
export PKG_CONFIG_PATH
|
||||
fi
|
||||
if test x$bdb_prefix != x; then
|
||||
CPPFLAGS="$CPPFLAGS -I$bdb_prefix/include"
|
||||
@ -1227,7 +1218,6 @@ if test "x$enable_fuzz" = "xyes"; then
|
||||
bitcoin_enable_qt_dbus=no
|
||||
enable_wallet=no
|
||||
use_bench=no
|
||||
use_openssl=no
|
||||
use_upnp=no
|
||||
use_natpmp=no
|
||||
use_zmq=no
|
||||
@ -1439,9 +1429,7 @@ if test x$use_pkgconfig = xyes; then
|
||||
m4_ifdef(
|
||||
[PKG_CHECK_MODULES],
|
||||
[
|
||||
if test x$use_openssl != xno; then
|
||||
PKG_CHECK_MODULES([CRYPTO], [libcrypto],, [use_openssl=no])
|
||||
fi
|
||||
PKG_CHECK_MODULES([CRYPTO], [libcrypto],,[AC_MSG_ERROR(libcrypto not found.)])
|
||||
if test x$use_qr != xno; then
|
||||
BITCOIN_QT_CHECK([PKG_CHECK_MODULES([QR], [libqrencode], [have_qrencode=yes], [have_qrencode=no])])
|
||||
fi
|
||||
@ -1464,10 +1452,8 @@ if test x$use_pkgconfig = xyes; then
|
||||
]
|
||||
)
|
||||
else
|
||||
if test x$use_openssl != xno; then
|
||||
AC_CHECK_HEADER([openssl/crypto.h],,[use_openssl=no])
|
||||
AC_CHECK_LIB([crypto], [main],CRYPTO_LIBS=-lcrypto, [use_openssl=no])
|
||||
fi
|
||||
AC_CHECK_HEADER([openssl/crypto.h],,AC_MSG_ERROR(libcrypto headers missing))
|
||||
AC_CHECK_LIB([crypto], [main],CRYPTO_LIBS=-lcrypto, AC_MSG_ERROR(libcrypto missing))
|
||||
|
||||
if test x$build_bitcoin_cli$build_bitcoind$bitcoin_enable_qt$use_tests != xnononono; then
|
||||
AC_CHECK_HEADER([event2/event.h],, AC_MSG_ERROR(libevent headers missing),)
|
||||
@ -1711,10 +1697,6 @@ if test x$bitcoin_enable_qt != xno; then
|
||||
fi
|
||||
fi
|
||||
|
||||
if test x$use_openssl = xyes; then
|
||||
AC_DEFINE([USE_OPENSSL],[1],[Define to 1 to use OpenSSL])
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL([ENABLE_ZMQ], [test "x$use_zmq" = "xyes"])
|
||||
|
||||
AC_MSG_CHECKING([whether to build test_dash])
|
||||
@ -1896,7 +1878,6 @@ echo " with gui / qt = $bitcoin_enable_qt"
|
||||
if test x$bitcoin_enable_qt != xno; then
|
||||
echo " with qr = $use_qr"
|
||||
fi
|
||||
echo " with openssl = $use_openssl"
|
||||
echo " with zmq = $use_zmq"
|
||||
echo " with test = $use_tests"
|
||||
echo " with bench = $use_bench"
|
||||
|
@ -33,7 +33,6 @@ WORK_PATH = $(BASEDIR)/work
|
||||
BASE_CACHE ?= $(BASEDIR)/built
|
||||
SDK_PATH ?= $(BASEDIR)/SDKs
|
||||
NO_QT ?=
|
||||
NO_OPENSSL ?=
|
||||
NO_WALLET ?=
|
||||
NO_ZMQ ?=
|
||||
NO_UPNP ?=
|
||||
@ -137,15 +136,10 @@ upnp_packages_$(NO_UPNP) = $(upnp_packages)
|
||||
natpmp_packages_$(NO_NATPMP) = $(natpmp_packages)
|
||||
|
||||
zmq_packages_$(NO_ZMQ) = $(zmq_packages)
|
||||
openssl_packages_$(NO_OPENSSL) = $(openssl_packages)
|
||||
|
||||
packages += $($(host_arch)_$(host_os)_packages) $($(host_os)_packages) $(qt_packages_) $(wallet_packages_) $(upnp_packages_) $(natpmp_packages_)
|
||||
native_packages += $($(host_arch)_$(host_os)_native_packages) $($(host_os)_native_packages)
|
||||
|
||||
ifneq ($(openssl_packages_),)
|
||||
packages += $(openssl_packages)
|
||||
endif
|
||||
|
||||
ifneq ($(zmq_packages_),)
|
||||
packages += $(zmq_packages)
|
||||
endif
|
||||
|
@ -1,6 +1,4 @@
|
||||
packages:=boost libevent gmp bls-dash backtrace cmake immer
|
||||
|
||||
openssl_packages = openssl
|
||||
packages:=boost openssl libevent gmp bls-dash backtrace cmake immer
|
||||
|
||||
qt_packages = qrencode zlib
|
||||
|
||||
|
@ -25,9 +25,7 @@
|
||||
#include <QObject>
|
||||
#include <QTest>
|
||||
|
||||
#if USE_OPENSSL
|
||||
#include <openssl/ssl.h>
|
||||
#endif
|
||||
|
||||
#if defined(QT_STATICPLUGIN)
|
||||
#include <QtPlugin>
|
||||
|
@ -44,10 +44,8 @@
|
||||
#include <cpuid.h>
|
||||
#endif
|
||||
|
||||
#if USE_OPENSSL
|
||||
#include <openssl/rand.h>
|
||||
#include <openssl/conf.h>
|
||||
#endif
|
||||
|
||||
[[noreturn]] static void RandFailure()
|
||||
{
|
||||
@ -402,9 +400,7 @@ void GetOSRand(unsigned char *ent32)
|
||||
#endif
|
||||
}
|
||||
|
||||
#if USE_OPENSSL
|
||||
void LockingCallbackOpenSSL(int mode, int i, const char* file, int line);
|
||||
#endif
|
||||
|
||||
namespace {
|
||||
|
||||
@ -428,7 +424,6 @@ public:
|
||||
{
|
||||
InitHardwareRand();
|
||||
|
||||
#if USE_OPENSSL
|
||||
// Init OpenSSL library multithreading support
|
||||
m_mutex_openssl.reset(new Mutex[CRYPTO_num_locks()]);
|
||||
CRYPTO_set_locking_callback(LockingCallbackOpenSSL);
|
||||
@ -439,17 +434,14 @@ public:
|
||||
// or corrupt. Explicitly tell OpenSSL not to try to load the file. The result for our libs will be
|
||||
// that the config appears to have been loaded and there are no modules/engines available.
|
||||
OPENSSL_no_config();
|
||||
#endif
|
||||
}
|
||||
|
||||
~RNGState()
|
||||
{
|
||||
#if USE_OPENSSL
|
||||
// Securely erase the memory used by the OpenSSL PRNG
|
||||
RAND_cleanup();
|
||||
// Shutdown OpenSSL library multithreading support
|
||||
CRYPTO_set_locking_callback(nullptr);
|
||||
#endif
|
||||
}
|
||||
|
||||
/** Extract up to 32 bytes of entropy from the RNG state, mixing in new entropy from hasher.
|
||||
@ -486,9 +478,7 @@ public:
|
||||
return ret;
|
||||
}
|
||||
|
||||
#if USE_OPENSSL
|
||||
Mutex& GetOpenSSLMutex(int i) { return m_mutex_openssl[i]; }
|
||||
#endif
|
||||
};
|
||||
|
||||
RNGState& GetRNGState() noexcept
|
||||
@ -500,7 +490,6 @@ RNGState& GetRNGState() noexcept
|
||||
}
|
||||
}
|
||||
|
||||
#if USE_OPENSSL
|
||||
void LockingCallbackOpenSSL(int mode, int i, const char* file, int line) NO_THREAD_SAFETY_ANALYSIS
|
||||
{
|
||||
RNGState& rng = GetRNGState();
|
||||
@ -511,7 +500,6 @@ void LockingCallbackOpenSSL(int mode, int i, const char* file, int line) NO_THRE
|
||||
rng.GetOpenSSLMutex(i).unlock();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* A note on the use of noexcept in the seeding functions below:
|
||||
*
|
||||
@ -550,11 +538,9 @@ static void SeedSlow(CSHA512& hasher) noexcept
|
||||
GetOSRand(buffer);
|
||||
hasher.Write(buffer, sizeof(buffer));
|
||||
|
||||
#if USE_OPENSSL
|
||||
// OpenSSL RNG (for now)
|
||||
RAND_bytes(buffer, sizeof(buffer));
|
||||
hasher.Write(buffer, sizeof(buffer));
|
||||
#endif
|
||||
|
||||
// High-precision timestamp.
|
||||
//
|
||||
@ -649,7 +635,6 @@ static void ProcRand(unsigned char* out, int num, RNGLevel level)
|
||||
rng.MixExtract(out, num, std::move(startup_hasher), true);
|
||||
}
|
||||
|
||||
#if USE_OPENSSL
|
||||
// For anything but the 'fast' level, feed the resulting RNG output (after an additional hashing step) back into OpenSSL.
|
||||
if (level != RNGLevel::FAST) {
|
||||
unsigned char buf[64];
|
||||
@ -657,7 +642,6 @@ static void ProcRand(unsigned char* out, int num, RNGLevel level)
|
||||
RAND_add(buf, sizeof(buf), num);
|
||||
memory_cleanse(buf, 64);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
std::chrono::microseconds GetRandMicros(std::chrono::microseconds duration_max) noexcept
|
||||
|
Loading…
Reference in New Issue
Block a user