Skip to content

PS-11106 [trunk] Component Percona keyring encrypted file - #6112

Open
catalinbp wants to merge 1 commit into
percona:trunkfrom
catalinbp:PS-11106-trunk
Open

PS-11106 [trunk] Component Percona keyring encrypted file#6112
catalinbp wants to merge 1 commit into
percona:trunkfrom
catalinbp:PS-11106-trunk

Conversation

@catalinbp

Copy link
Copy Markdown
Contributor
  • Created component_percona_keyring_encrypted_file based on component_keyring_file.
  • Added cmake flag: WITH_COMPONENT_PERCONA_KEYRING_ENCRYPTED_FILE
  • New PBKDF2-based encrypt/decrypt API (aes.cc): Added aes_encrypt_pbkdf2 and aes_decrypt_pbkdf2 functions that derive a 256-bit AES key from a password using PKCS5_PBKDF2_HMAC (SHA-256). Refactored the internal EVP encrypt/decrypt logic into private helpers to avoid code duplication.
  • Encrypted backend (backend.cc): Renamed Keyring_file_backend to Keyring_encrypted_file_backend and wired in password-based encryption. On write, generates a random salt, IV, and iteration count; on read, parses v1 on-disk header ([version:1][salt:32][iterations:4 BE][iv:16][ciphertext]) and decrypts before JSON parsing.
  • Password config options (config.cc): The component configuration now requires exactly one of password (inline) or password_file (path to a file containing the password). Validation errors are emitted for missing, empty, or conflicting combinations. The
    keyring_component_status table reports or for the password field.

@catalinbp
catalinbp requested a review from jankowsk July 29, 2026 10:15
- Created component_percona_keyring_encrypted_file based on
component_keyring_file.
- Added cmake flag: WITH_COMPONENT_PERCONA_KEYRING_ENCRYPTED_FILE
- New PBKDF2-based encrypt/decrypt API (aes.cc): Added
aes_encrypt_pbkdf2 and aes_decrypt_pbkdf2 functions that derive a
256-bit AES key from a password using PKCS5_PBKDF2_HMAC (SHA-256).
Refactored the internal EVP encrypt/decrypt logic into private helpers
to avoid code duplication.
- Encrypted backend (backend.cc): Renamed Keyring_file_backend to
Keyring_encrypted_file_backend and wired in password-based encryption.
On write, generates a random salt, IV, and iteration count; on read,
parses v1 on-disk header ([version:1][salt:32][iterations:4
BE][iv:16][ciphertext]) and decrypts before JSON parsing.
- Password config options (config.cc): The component configuration now
requires exactly one of password (inline) or password_file (path to a
file containing the password). Validation errors are emitted for
missing, empty, or conflicting combinations. The
keyring_component_status table reports <SET> or <NONE> for the password
field.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant