Fix errorhandling for PGP encryption PGP encryption was using px_cipher_encrypt without checking if any error was returned. When OpenSSL is running in FIPS mode, or when the legacy provider hasn't been loaded, not all ciphers which are supported by the PGP code are available and fail the init step in px_cipher_encrypt. Since the PGP encryption failed to notice this it XORed the non-encrypted block with the plaintext, effectively disabling the encryption.
This was found due to a report of PGP encryption not respecting the pgcrypto.builtin_crypto_enabled flag and allowing Blowfish and DES. This however turned out to be a false positive, since the PGP code only use ciphers from OpenSSL and not the built in ciphers. Bug: #19457 Reported-by: Shishir Sharma <[email protected]> Reviewed-by: Jacob Champion <[email protected]> Discussion: https://postgr.es/m/[email protected] Security: CVE-2026-14663 Backpatch-through: 14 Branch ------ REL_15_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/472ef7e4a1d755723adf4c0b24851d822c0ef9f7 Author: Daniel Gustafsson <[email protected]> Modified Files -------------- contrib/pgcrypto/expected/pgp-decrypt_1.out | 2 +- contrib/pgcrypto/expected/pgp-encrypt_1.out | 200 +++++++++++++++++++++ contrib/pgcrypto/expected/pgp-pubkey-decrypt_1.out | 2 +- contrib/pgcrypto/pgp-cfb.c | 8 +- 4 files changed, 209 insertions(+), 3 deletions(-)
