From aecaa04418f39c32adb3dbf91c4aa7f6e175f01c Mon Sep 17 00:00:00 2001 From: Michael Paquier Date: Sun, 1 Nov 2020 19:22:59 +0900 Subject: 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 --- contrib/pgcrypto/openssl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'contrib/pgcrypto/openssl.c') diff --git a/contrib/pgcrypto/openssl.c b/contrib/pgcrypto/openssl.c index ed96e4ce535..5ebe2134069 100644 --- a/contrib/pgcrypto/openssl.c +++ b/contrib/pgcrypto/openssl.c @@ -400,7 +400,7 @@ gen_ossl_encrypt(PX_Cipher *c, const uint8 *data, unsigned dlen, } if (!EVP_EncryptUpdate(od->evp_ctx, res, &outlen, data, dlen)) - return PXE_ERR_GENERIC; + return PXE_ENCRYPT_FAILED; return 0; } -- cgit v1.2.3