1
0
mirror of https://github.com/codership/wsrep-lib.git synced 2025-07-03 16:22:35 +03:00
* Created interface class for encryption support
* Implemented function for setting enc key to provider, callback function for encryption/decryption
This commit is contained in:
mkaruza
2018-11-10 11:07:52 +01:00
parent e7f2dfdf93
commit e7d72ae7f6
9 changed files with 178 additions and 17 deletions

View File

@ -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
{