diff options
author | Cory Fields <cory-nospam-@coryfields.com> | 2015-07-14 17:38:03 -0400 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2015-07-15 15:51:05 +0200 |
commit | 253143860da9983d127251814f0665a5454e5030 (patch) | |
tree | 3f3b2ed5a290419cb56a044b415d15203ba913c8 /src/util.cpp | |
parent | 164966705a43f4543c08b9c603c665ff39b8ea89 (diff) | |
download | bitcoin-253143860da9983d127251814f0665a5454e5030.tar.xz |
openssl: avoid config file load/race
Github-Pull: #6438
Rebased-From: d4b1d5a8baf18e4c8d62846360c0c1c0c9331d70
Diffstat (limited to 'src/util.cpp')
-rw-r--r-- | src/util.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/util.cpp b/src/util.cpp index bfb95c9044..82aa8887fa 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -83,6 +83,7 @@ #include <boost/thread.hpp> #include <openssl/crypto.h> #include <openssl/rand.h> +#include <openssl/conf.h> // Work around clang compilation problem in Boost 1.46: // /usr/include/boost/program_options/detail/config_file.hpp:163:17: error: call to function 'to_internal' that is neither visible in the template definition nor found by argument-dependent lookup @@ -134,6 +135,13 @@ public: ppmutexOpenSSL[i] = new CCriticalSection(); CRYPTO_set_locking_callback(locking_callback); + // OpenSSL can optionally load a config file which lists optional loadable modules and engines. + // We don't use them so we don't require the config. However some of our libs may call functions + // which attempt to load the config file, possibly resulting in an exit() or crash if it is missing + // 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(); + #ifdef WIN32 // Seed OpenSSL PRNG with current contents of the screen RAND_screen(); |