MySQL 8.0.31
Source Code Documentation
log0encryption.h File Reference

Redo log - encryption. More...

#include "univ.i"

Go to the source code of this file.

Functions

Log - encryption management.
bool log_file_header_fill_encryption (const Encryption_metadata &encryption_metadata, bool encrypt_key, byte *buf)
 Writes encryption information to log header. More...
 
dberr_t log_encryption_read (log_t &log)
 Reads the log encryption header to get the redo log encryption information. More...
 
dberr_t log_encryption_read (log_t &log, const Log_file &file)
 Reads the log encryption header to get the redo log encryption information. More...
 
dberr_t log_encryption_generate_metadata (log_t &log)
 Enables the redo log encryption and generates new encryption metadata. More...
 
dberr_t log_encryption_on_master_key_changed (log_t &log)
 Re-encrypts the redo log's encryption metadata using the current master key and writes it encrypted to the log encryption header in the log file containing the current checkpoint lsn (log.last_checkpoint_lsn)). More...
 
bool log_can_encrypt (const log_t &log)
 

Detailed Description

Redo log - encryption.

Function Documentation

◆ log_can_encrypt()

bool log_can_encrypt ( const log_t log)
Returns
true iff redo log is encrypted (checks in-memory metadata in log_t).

◆ log_encryption_generate_metadata()

dberr_t log_encryption_generate_metadata ( log_t log)

Enables the redo log encryption and generates new encryption metadata.

Writes the generated metadata to the log encryption header in the log file containing the current checkpoint lsn (log.last_checkpoint_lsn).

Parameters
[in,out]logredo log
Returns
DB_SUCCESS or DB_ERROR

◆ log_encryption_on_master_key_changed()

dberr_t log_encryption_on_master_key_changed ( log_t log)

Re-encrypts the redo log's encryption metadata using the current master key and writes it encrypted to the log encryption header in the log file containing the current checkpoint lsn (log.last_checkpoint_lsn)).

Remarks
This is called after the new master key has been generated.
Returns
DB_SUCCESS or DB_ERROR

◆ log_encryption_read() [1/2]

dberr_t log_encryption_read ( log_t log)

Reads the log encryption header to get the redo log encryption information.

Read is done using the file which contains the current checkpoint_lsn. Updates: log.m_encryption_metadata and log.m_encryption_buf.

Parameters
[in,out]logredo log
Returns
DB_SUCCESS or DB_ERROR

◆ log_encryption_read() [2/2]

dberr_t log_encryption_read ( log_t log,
const Log_file file 
)

Reads the log encryption header to get the redo log encryption information.

Read is done using the provided file. Updates: log.m_encryption_metadata and log.m_encryption_buf.

Parameters
[in,out]logredo log
[in]fileredo file to read from
Returns
DB_SUCCESS or DB_ERROR

◆ log_file_header_fill_encryption()

bool log_file_header_fill_encryption ( const Encryption_metadata encryption_metadata,
bool  encrypt_key,
byte buf 
)

Writes encryption information to log header.

Parameters
[in]encryption_metadataencryption metadata (algorithm, key, iv)
[in]encrypt_keyencrypt with master key
[in,out]buflog file encryption header