> On 17 Apr 2026, at 06:21, PG Bug reporting form <noreply@postgresql.org> wrote:
> I am happy to work on this.
Please do, that would be great. I'd be happy to review this so keep me CC'd.
> Add a FIPS cipher check in pgp_load_cipher() in contrib/pgcrypto/pgp.c.
> This function is the single chokepoint for all PGP cipher operations
> (encrypt, decrypt, session key encryption/decryption). A whitelist of
> FIPS 140-2/140-3 approved ciphers for PGP use would be:
>
> PGP_SYM_AES_128, PGP_SYM_AES_192, PGP_SYM_AES_256
Maybe an extra flag in the cipher_info struct?
> All other ciphers (PGP_SYM_BLOWFISH, PGP_SYM_CAST5, PGP_SYM_DES3,
> PGP_SYM_TWOFISH, etc.) should raise an error when CheckFIPSMode()
> returns true.
Not just FIPS, it should check CheckBuiltinCryptoMode() to be consistent with
the other builtin checks.
--
Daniel Gustafsson