aboutsummaryrefslogtreecommitdiff
path: root/contrib/pgcrypto/px.c
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2020-11-01 19:22:59 +0900
committerMichael Paquier <michael@paquier.xyz>2020-11-01 19:22:59 +0900
commitaecaa04418f39c32adb3dbf91c4aa7f6e175f01c (patch)
tree653b9735c49efc78dd033e40f23870c941973550 /contrib/pgcrypto/px.c
parentd2246cde825e4e1a85408390c66367b85b51a233 (diff)
downloadpostgresql-aecaa04418f39c32adb3dbf91c4aa7f6e175f01c.tar.gz
postgresql-aecaa04418f39c32adb3dbf91c4aa7f6e175f01c.zip
Add error code for encryption failure in pgcrypto
PXE_DECRYPT_FAILED exists already for decryption errors, and an equivalent for encryption did not exist. There is one code path that deals with such failures for OpenSSL but it used PXE_ERR_GENERIC, which was inconsistent. This switches this code path to use the new error PXE_ENCRYPT_FAILED instead of PXE_ERR_GENERIC, making the code used for encryption more consistent with the decryption. Author: Daniel Gustafsson Discussion: https://postgr.es/m/03049139-CB7A-436E-B71B-42696D3E2EF7@yesql.se
Diffstat (limited to 'contrib/pgcrypto/px.c')
-rw-r--r--contrib/pgcrypto/px.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/contrib/pgcrypto/px.c b/contrib/pgcrypto/px.c
index 6a4681dae98..a243f575d3b 100644
--- a/contrib/pgcrypto/px.c
+++ b/contrib/pgcrypto/px.c
@@ -58,6 +58,7 @@ static const struct error_desc px_err_list[] = {
{PXE_MCRYPT_INTERNAL, "mcrypt internal error"},
{PXE_NO_RANDOM, "Failed to generate strong random bits"},
{PXE_DECRYPT_FAILED, "Decryption failed"},
+ {PXE_ENCRYPT_FAILED, "Encryption failed"},
{PXE_PGP_CORRUPT_DATA, "Wrong key or corrupt data"},
{PXE_PGP_CORRUPT_ARMOR, "Corrupt ascii-armor"},
{PXE_PGP_UNSUPPORTED_COMPR, "Unsupported compression algorithm"},