MDEV-11288 Server crashes in Binlog_crypt_data::init trying to feed encrypted log without decryption capabilities

This commit is contained in:
Sergei Golubchik
2016-12-03 20:26:42 +01:00
parent 611f91605a
commit 952856c810
5 changed files with 115 additions and 20 deletions

View File

@ -29,6 +29,10 @@ uint no_key(uint)
{
return ENCRYPTION_KEY_VERSION_INVALID;
}
uint zero_size(uint,uint)
{
return 0;
}
static int ctx_init(void *ctx, const unsigned char* key, unsigned int klen,
const unsigned char* iv, unsigned int ivlen, int flags,
@ -97,6 +101,7 @@ int finalize_encryption_plugin(st_plugin_int *plugin)
encryption_handler.encryption_key_get_func=
(uint (*)(uint, uint, uchar*, uint*))no_key;
encryption_handler.encryption_key_get_latest_version_func= no_key;
encryption_handler.encryption_ctx_size_func= zero_size;
if (plugin && plugin->plugin->deinit && plugin->plugin->deinit(NULL))
{