mirror of
https://github.com/codership/wsrep-lib.git
synced 2025-07-03 16:22:35 +03:00
codership/mariadb-wsrep#27 Galera cache encryption
* Created interface class for encryption support * Implemented function for setting enc key to provider, callback function for encryption/decryption
This commit is contained in:
@ -337,12 +337,12 @@ static int apply_toi(wsrep::provider& provider,
|
||||
int wsrep::server_state::load_provider(const std::string& provider_spec,
|
||||
const std::string& provider_options)
|
||||
{
|
||||
wsrep::log_info() << "Loading provider "
|
||||
<< provider_spec
|
||||
<< "initial position: "
|
||||
<< initial_position_;
|
||||
provider_ = wsrep::provider::make_provider(
|
||||
*this, provider_spec, provider_options);
|
||||
wsrep::log_info() << "Loading provider " << provider_spec
|
||||
<< "initial position: " << initial_position_;
|
||||
|
||||
provider_ = wsrep::provider::make_provider(*this,
|
||||
provider_spec,
|
||||
provider_options);
|
||||
return (provider_ ? 0 : 1);
|
||||
}
|
||||
|
||||
@ -630,6 +630,18 @@ wsrep::server_state::wait_for_gtid(const wsrep::gtid& gtid, int timeout)
|
||||
return provider().wait_for_gtid(gtid, timeout);
|
||||
}
|
||||
|
||||
int
|
||||
wsrep::server_state::set_encryption_key(std::vector<unsigned char>& key)
|
||||
{
|
||||
encryption_key_ = key;
|
||||
if (state_ != s_disconnected)
|
||||
{
|
||||
return provider_->enc_set_key(wsrep::const_buffer(encryption_key_.data(),
|
||||
encryption_key_.size()));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::pair<wsrep::gtid, enum wsrep::provider::status>
|
||||
wsrep::server_state::causal_read(int timeout) const
|
||||
{
|
||||
|
Reference in New Issue
Block a user