model-writtenrun 8017 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
Feb - Oct 2020 ยท 23 entries
- Masahiko Sawada opened the thread to separate internal key management from the larger transparent-data-encryption effort, targeting PostgreSQL 13 with a passphrase-protected master key and SQL wrapping functions #1.
- Fabien COELHO and Robert Haas questioned exposing unwrapped secrets, while Sawada clarified the protection against stolen database files; Haas also proposed protocol-level secret exchange to avoid leaking keys into SQL logs #2 #8 #25.
- Sehrope Sarkuni outlined authenticated wrapping with separate encryption and MAC keys, and the implementation proceeded with OpenSSL calls despite disagreement over placing cryptographic infrastructure in core or an extension #5 #12 #17 #21.
- Sawada's first attached patch implemented master-key storage in pg_control and online passphrase rotation, while explicitly leaving crash recovery during rotation unresolved #20.
- Cary Huang's testing found truncated unwrap results and inconsistencies in cipher handling; Sawada fixed the result sizing, simplified initdb activation, and added initial documentation and tests #26 #30.
- Huang supplied a separate pg_waldump integration patch demonstrating frontend access to the keys, but that add-on was not incorporated into the subsequent main KMS submissions #31.
- Huang's review clarified the distinction between user secrets and cryptographic keys, leading to pg_wrap/pg_unwrap names and corrected argument types; Sawada resent the patch after accidentally attaching only diff statistics #32 #33 #34 #35.
- Bruce Momjian pressed for separate SQL and block-encryption key spaces, and Sawada added pg_upgrade support before implementing an HKDF-derived SQL key #36 #38 #41 #47.
- A crypto-team discussion favored independent keys so they could be migrated and rotated separately, prompting Sawada to remove HKDF and move the two wrapped keys into global/pg_key because pg_control would exceed its safe size #48 #49.
- Momjian then proposed separate SQL, block, and WAL key files plus directory-based rotation, which Sawada implemented with startup recovery for interrupted rotations #51 #53 #56.
- Huang found pg_upgrade failures with mismatched passphrases and a misleading recovery diagnostic; Sawada corrected the copying condition and documented the requirement for matching cluster passphrases #58 #59.
- Huang rewrote the design documentation, and Sawada subsequently produced a seven-patch redesign with variable-length keys in shared memory, reusable AEAD support, SQL encryption functions, and a libpq/psql experiment intended to avoid logging secrets #62 #63.
- Haas rejected relying on PQfn's lack of logging, while Huang argued that the SQL encryption interface was outside the internal manager's scope and Sawada agreed it could be deferred #64 #68 #69.
- COELHO advocated keeping the key-encryption key outside PostgreSQL behind an extensible interface; Sawada and Momjian questioned the added complexity, leaving that architectural disagreement unresolved #65 #66 #73 #80 #81.
- Sawada narrowed the series to key-management infrastructure for future file encryption, removing the SQL key and interfaces, their tests, and the libpq experiment so discussion could focus on the manager itself #90.
- After a July rebase and a September conflict report, Momjian resumed development in October, fixing compilation and documentation and discovering that the zero-key configuration could not validate startup passphrases #91 #92 #93.
- Momjian also found that pg_ctl's daemonization prevented terminal prompting; Tom Lane opposed moving daemonization, leading Momjian to pass an already-open terminal descriptor to the server instead #93 #94 #95.
- Craig Ringer called for support for hardware-protected key-encryption keys and a pluggable operations interface, while Stephen Frost explored vaults, hardware offload, and alternatives to OpenSSL-specific configuration #97 #99 #98 #109.
- Momjian agreed to focus on file encryption and identified the zero-key configuration as uncommittable, then posted terminal-descriptor support using -R and %R #101 #104.
- Ringer reviewed the updated implementation and outlined a larger pluggable-key redesign; Momjian's final attachment incorporated the naming, comment, and unused-field fixes while leaving the larger abstraction work open #106 #112.
- WAL-key rotation remained unsettled: Sawada raised the need to decrypt archived WAL from older key generations, while Momjian preferred an external tool to re-encrypt archived WAL #107 #108.
- At the thread's end, the infrastructure was still under review, SQL-level functionality was deferred, and Ringer continued advocating a simple default key provider with extensible loading and operations #113.
- The eventual December landing, 978f869b99, belongs to the later submissions in thread #43343, whose supplied attribution identifies #465136; it added two data keys with GCM wrapping and substantially revised the implementation developed here.