File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,11 @@ if(LINUX)
5555 CHECK_INCLUDE_FILES("sched.h" HAVE_SCHED)
5656endif ()
5757CHECK_INCLUDE_FILES("valgrind/helgrind.h" HAVE_VALGRIND_HELGRIND_H)
58+ CHECK_INCLUDE_FILES("openssl/engine.h" HAVE_OPENSSL_ENGINE_H)
59+ option (WITH_OPENSSL_ENGINE "Build with OpenSSL Engine Support" )
60+ if (WITH_OPENSSL_ENGINE AND NOT HAVE_OPENSSL_ENGINE)
61+ message (FATAL_ERROR "Can't find openssl/engine.h" )
62+ endif ()
5863
5964include (CheckTypeSize)
6065set (CMAKE_EXTRA_INCLUDE_FILES "linux/types.h" "netinet/in.h" )
Original file line number Diff line number Diff line change 1616
1717#include < openssl/bio.h>
1818#include < openssl/conf.h>
19+ #ifndef OPENSSL_NO_ENGINE
1920#include < openssl/engine.h>
21+ #endif
2022#include < mutex>
2123#include < vector>
2224#include < algorithm>
@@ -40,6 +42,9 @@ static ostream &_prefix(std::ostream *_dout)
4042{
4143 return *_dout << " OpenSSLOptsHandler: " ;
4244}
45+
46+ #ifndef OPENSSL_NO_ENGINE
47+
4348// -----------------------------------------------------------------------------
4449
4550string construct_engine_conf (const string &opts)
@@ -128,15 +133,20 @@ void load_module(const string &engine_conf)
128133 log_error (" failed to load modules from CONF:\n " + get_openssl_error ());
129134 }
130135}
136+ #endif // !OPENSSL_NO_ENGINE
131137
132138void init_engine ()
133139{
134140 string opts = g_ceph_context->_conf ->openssl_engine_opts ;
135141 if (opts.empty ()) {
136142 return ;
137143 }
144+ #ifdef OPENSSL_NO_ENGINE
145+ derr << " OpenSSL is compiled with no engine, but openssl_engine_opts is set" << dendl;
146+ #else
138147 string engine_conf = construct_engine_conf (opts);
139148 load_module (engine_conf);
149+ #endif
140150}
141151
142152void ceph::crypto::init_openssl_engine_once ()
You can’t perform that action at this time.
0 commit comments