Consistent error reporting for encryption/decryption in pgcrypto

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Consistent error reporting for encryption/decryption in pgcrypto
Date: 2020-10-29 21:26:54
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Commit b918bf86c65 added the errorcode PXE_DECRYPT_FAILED to the existing set
of PXE_ error codes. When pgcrypto was changed to the EVP APIs in 5ff4a67f63,
no new error codes were added in favour of existing ones. This results in
encryption failures returning PXE_ERR_GENERIC, which seems a bit inconsistent.

The attached introduce PXE_ENCRYPT_FAILED and use that for EVP_EncryptUpdate to
ideally be slightly clearer in case of errors. Any reason not to do that
instead of using ERR_GENERIC?

cheers ./daniel

Attachment Content-Type Size
0001-Use-a-more-descriptive-error-for-failed-encryption.patch application/octet-stream 1.5 KB


Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2020-10-29 21:36:31 Re: Autovacuum worker doesn't immediately exit on postmaster death
Previous Message Fujii Masao 2020-10-29 20:00:39 Re: Disable WAL logging to speed up data loading