mirror of
https://github.com/codership/wsrep-lib.git
synced 2025-07-21 12:22:06 +03:00
Revert "codership/mariadb-wsrep#27 Galera cache encryption"
This reverts commit 7e9419e811
.
This commit is contained in:
@ -20,7 +20,6 @@
|
||||
#include "wsrep_provider_v26.hpp"
|
||||
|
||||
#include "wsrep/server_state.hpp"
|
||||
#include "wsrep/server_service.hpp"
|
||||
#include "wsrep/high_priority_service.hpp"
|
||||
#include "wsrep/view.hpp"
|
||||
#include "wsrep/exception.hpp"
|
||||
@ -422,36 +421,14 @@ namespace
|
||||
}
|
||||
}
|
||||
|
||||
int encrypt_cb(void* app_ctx,
|
||||
wsrep_enc_ctx_t* enc_ctx,
|
||||
const wsrep_buf_t* input,
|
||||
void* output,
|
||||
wsrep_enc_direction_t direction,
|
||||
bool last)
|
||||
wsrep_cb_status_t encrypt_cb(void* /* app ctx */,
|
||||
wsrep_enc_ctx_t* /*ctx*/,
|
||||
const wsrep_buf_t* /*input*/,
|
||||
void* /*output*/,
|
||||
wsrep_enc_direction_t /*direction*/,
|
||||
bool /*final*/)
|
||||
{
|
||||
assert(app_ctx);
|
||||
wsrep::server_state& server_state(
|
||||
*static_cast<wsrep::server_state*>(app_ctx));
|
||||
|
||||
|
||||
wsrep::const_buffer key(enc_ctx->key->ptr, enc_ctx->key->len);
|
||||
wsrep::const_buffer in(input->ptr, input->len);
|
||||
try
|
||||
{
|
||||
return server_state.server_service().do_crypt(&enc_ctx->ctx,
|
||||
key,
|
||||
enc_ctx->iv,
|
||||
in,
|
||||
output,
|
||||
direction == WSREP_ENC,
|
||||
last);
|
||||
}
|
||||
catch (const wsrep::runtime_error& e)
|
||||
{
|
||||
free(enc_ctx->ctx);
|
||||
// Return negative value in case of callback error
|
||||
return -1;
|
||||
}
|
||||
return WSREP_CB_SUCCESS;
|
||||
}
|
||||
|
||||
wsrep_cb_status_t apply_cb(void* ctx,
|
||||
@ -605,16 +582,6 @@ wsrep::wsrep_provider_v26::wsrep_provider_v26(
|
||||
{
|
||||
throw wsrep::runtime_error("Failed to initialize wsrep provider");
|
||||
}
|
||||
|
||||
const std::vector<unsigned char>& key = server_state.get_encryption_key();
|
||||
if (key.size())
|
||||
{
|
||||
wsrep::const_buffer const_key(key.data(), key.size());
|
||||
if(enc_set_key(const_key))
|
||||
{
|
||||
throw wsrep::runtime_error("Failed to set encryption key");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
wsrep::wsrep_provider_v26::~wsrep_provider_v26()
|
||||
@ -889,16 +856,6 @@ int wsrep::wsrep_provider_v26::sst_received(const wsrep::gtid& gtid, int err)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int wsrep::wsrep_provider_v26::enc_set_key(const wsrep::const_buffer& key)
|
||||
{
|
||||
wsrep_enc_key_t enc_key = {key.data(), key.size()};
|
||||
if (wsrep_->enc_set_key(wsrep_, &enc_key) != WSREP_OK)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::vector<wsrep::provider::status_variable>
|
||||
wsrep::wsrep_provider_v26::status() const
|
||||
{
|
||||
|
Reference in New Issue
Block a user