CryptoManager::cct is now used in CephContext ctor. To provide this
defintion
any ceph_context.cc target must also include Crypto.cc.
crimson-alien-common library which only had ceph_context.cc must now
also include Crypto.cc.
However, the fact that crimson-common also includes Crypto.cc would
cause multiple defintions
to any Crypto classes methods.
To resolve this, let's wrap all Crypto classes with TOPNSPC::common that
would be forwarded using common_fwd logic.
Signed-off-by: Matan Breizman <mbreizma@redhat.com>
(cherry picked from commit
0e3e34565f5730f8baefecde9be592587129ba9d)
}
}
+namespace TOPNSPC::auth {
+
CryptoRandom::CryptoRandom() : fd(getentropy_works() ? -1 : open_urandom())
{}
#include <bcrypt.h>
+namespace TOPNSPC::auth {
+
CryptoRandom::CryptoRandom() : fd(0) {}
CryptoRandom::~CryptoRandom() = default;
return supported_crypto_types.find(type) != supported_crypto_types.end();
}
+} // namespace TOPNSPC::auth
+
#pragma clang diagnostic pop
#pragma GCC diagnostic pop
class CryptoKeyContext;
namespace ceph { class Formatter; }
+namespace TOPNSPC::auth {
+
/*
* Random byte stream generator suitable for cryptographic use
*/
* To use these functions, you need to call ceph::crypto::init(), see
* common/ceph_crypto.h. common_init_finish does this for you.
*/
+
class CryptoHandler {
public:
virtual ~CryptoHandler() {}
};
+
class CryptoManager {
CephContext *cct;
std::shared_ptr<CryptoHandler> crypto_none;
std::shared_ptr<CryptoHandler> get_handler(int type);
};
-
+} // namespace TOPNSPC::auth
#endif
include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/src/rocksdb/include")
set(crimson_alien_common_srcs
+ ${PROJECT_SOURCE_DIR}/src/auth/Crypto.cc
${PROJECT_SOURCE_DIR}/src/common/admin_socket.cc
${PROJECT_SOURCE_DIR}/src/common/url_escape.cc
${PROJECT_SOURCE_DIR}/src/common/blkdev.cc
class RefCountedWaitObject;
class ConfigProxy;
}
+
+namespace TOPNSPC::auth {
+ class CryptoManager;
+ class CryptoHandler;
+ class CryptoKey;
+ class CryptoRandom;
+}
+
using TOPNSPC::common::CephContext;
using TOPNSPC::common::PerfCounters;
using TOPNSPC::common::PerfCountersBuilder;
using TOPNSPC::common::RefCountedCond;
using TOPNSPC::common::RefCountedWaitObject;
using TOPNSPC::common::ConfigProxy;
+using TOPNSPC::auth::CryptoManager;
+using TOPNSPC::auth::CryptoHandler;
+using TOPNSPC::auth::CryptoKey;
+using TOPNSPC::auth::CryptoRandom;