PBS-39 feature: Add binlog encryption config and keyring support (part 7) - #170
Merged
percona-ysorokin merged 1 commit intoAug 7, 2026
Merged
Conversation
…t 7) https://perconadev.atlassian.net/browse/PBS-39 Added more diagnostics for keyring data, encryption configuration parameter and their combinations - We now check that 'cipher' parameter in the keyring record is known to OpenSSL and is of 'ECB', 'CBC', 'CRT', or 'GCM' mode. - We now check that the actual length of the 'data_hex' matches the one derived from the 'cipher' (i.g., 256 bit / 32 bytes / 64 hexadecimal characters for 'AES-256-CTR'). - We now check the uniqueness of the key IDs ('id' field) amongst keyring records. - We also make sure that random file keys (of length that corresponds to the '<storage.encryption.cipher>' configuration parameter) can be encrypted with the active KEK ('<storage.encryption.kek_id>' configuration parameter). For instance, if active data cipher is 'AES-192-CRT' (key length 24 bytes), then the active KEK cannot be of 'ECB' or 'CBC' mode as these ciphers can only encrypt data of length that is a multiple of the block size (16 bytes). 'opensslpp::cipher_context' class extended with: - 'get_mode()' (both static and non-static versions) that returns the cipher mode ('ECB', 'CBC', 'CRT', or 'GCM'). - 'is_cipher_name_known()' (static) - returns true if this cipher name is known to OpenSSL. - 'is_mode_supported()' (static) - returns true if the mode is one of the 'ECB', 'CBC', 'CRT', or 'GCM'. - 'is_cipher_name_supported()' (static) - returns true if this cipher name is known to OpenSSL and its mode is supported. 'cipher_context_test.cpp' (BOOST_TEST_MODULE CipherContextTests) unit test extended with the following test cases. - 'CipherContextGetModeStatic' / 'CipherContextGetMode' that check for the behavior of the 'opensslpp::cipher_context::get_mode()' methods (both static and non-static). - 'CipherContextCTRResume' that checks for "resume streaming" operation for 'XXX-NNN-CTR' ciphers - creating a new encryption context, updating it with some data, finalizing, creating a new context with offset, updating it with more data, and finalizing. The result of this operation should be identical to simple encryption of the concatenated data blocks from the first and the second updates.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://perconadev.atlassian.net/browse/PBS-39
Added more diagnostics for keyring data, encryption configuration parameter and their combinations
'opensslpp::cipher_context' class extended with:
'cipher_context_test.cpp' (BOOST_TEST_MODULE CipherContextTests) unit test extended with the following test cases.