Commit e07f0a2d authored by Marko Mäkelä's avatar Marko Mäkelä

Merge 10.2 into 10.3

parents 6e94ef41 19716ad5
/*****************************************************************************
Copyright (C) 2013, 2015, Google Inc. All Rights Reserved.
Copyright (C) 2014, 2018, MariaDB Corporation.
Copyright (C) 2014, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
......@@ -164,6 +164,7 @@ static bool init_crypt_key(crypt_info_t* info, bool upgrade = false)
<< info->key_version << " failed (" << rc
<< "). Maybe the key or the required encryption "
"key management plugin was not found.";
info->key_version = ENCRYPTION_KEY_VERSION_INVALID;
return false;
}
......@@ -183,6 +184,7 @@ static bool init_crypt_key(crypt_info_t* info, bool upgrade = false)
if (err != MY_AES_OK || dst_len != MY_AES_BLOCK_SIZE) {
ib::error() << "Getting redo log crypto key failed: err = "
<< err << ", len = " << dst_len;
info->key_version = ENCRYPTION_KEY_VERSION_INVALID;
return false;
}
......@@ -276,6 +278,7 @@ log_crypt_101_read_block(byte* buf)
for (const crypt_info_t* const end = info + infos_used; info < end;
info++) {
if (info->key_version
&& info->key_version != ENCRYPTION_KEY_VERSION_INVALID
&& info->checkpoint_no == checkpoint_no) {
goto found;
}
......@@ -287,6 +290,9 @@ log_crypt_101_read_block(byte* buf)
/* MariaDB Server 10.1 would use the first key if it fails to
find a key for the current checkpoint. */
info = infos;
if (info->key_version == ENCRYPTION_KEY_VERSION_INVALID) {
return false;
}
found:
byte dst[OS_FILE_LOG_BLOCK_SIZE];
uint dst_len;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment