YoushouldhavereceivedacopyoftheGNUGeneralPublicLicense alongwiththisprogram;ifnot,writetotheFreeSoftware
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */
/* Now generate the local key by encrypting IV using the global key */
rc = my_aes_crypt(MY_AES_ECB, ENCRYPTION_FLAG_ENCRYPT | ENCRYPTION_FLAG_NOPAD,
scheme->iv, sizeof(scheme->iv), key->key, &key_len,
global_key, global_key_len, NULL, 0);
DBUG_ASSERT(key_len == sizeof(key->key));
if (rc) goto ret;
// Rotate keys to make room for a new for (uint i = array_elements(scheme->key) - 1; i; i--)
scheme->key[i] = scheme->key[i - 1];
scheme->key[0]= *key;
ret: if (scheme->locker)
scheme->locker(scheme, 1); return rc;
}
/** Run encryption or decryption on a block. *`i32_1`,`i32_2`,and`i64`areusedtocreatetheinitializationvector *@invariant`src`and`dst`invariantsarethesameasin`encryption_crypt`
*/ int do_crypt(constunsignedchar* src, unsignedint slen, unsignedchar* dst, unsignedint* dlen, struct st_encryption_scheme *scheme, unsignedint key_version, unsignedint i32_1, unsignedint i32_2, unsignedlonglong i64, int flag)
{
compile_time_assert(ENCRYPTION_SCHEME_KEY_INVALID ==
(int)ENCRYPTION_KEY_VERSION_INVALID);
// Maybe temporal solution for MDEV-8173 // Rationale: scheme->type is currently global/object // and when used here might not represent actual state // of smaller granularity objects e.g. InnoDB page state // as type is stored to tablespace (FIL) and could represent // state where key rotation is trying to reach //DBUG_ASSERT(scheme->type == 1);
if (key_version == ENCRYPTION_KEY_VERSION_INVALID ||
key_version == ENCRYPTION_KEY_NOT_ENCRYPTED) return ENCRYPTION_SCHEME_KEY_INVALID;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.