Consistent error reporting for encryption/decryption in pgcrypto
Daniel Gustafsson <daniel@yesql.se>
From: Daniel Gustafsson <daniel@yesql.se>
To: Postgres hackers <pgsql-hackers@lists.postgresql.org>
Date: 2020-10-29T21:26:54Z
Lists: pgsql-hackers
Attachments
- 0001-Use-a-more-descriptive-error-for-failed-encryption.patch (application/octet-stream) patch 0001
- (unnamed) (text/plain)
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
Commits
-
Add error code for encryption failure in pgcrypto
- aecaa04418f3 14.0 landed
-
Fix combo_decrypt() to throw an error for zero-length input when using a
- b918bf86c656 8.3.0 cited