Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adapt to Ubuntu env #488

Merged
merged 8 commits into from
Mar 10, 2024
Prev Previous commit
Next Next commit
pgcrypto: Check for error return of px_cipher_decrypt()
This has previously not been a problem (that anyone ever reported),
but in future OpenSSL versions (3.0.0), where legacy ciphers are/can
be disabled, this is the place where this is reported.  So we need to
catch the error here, otherwise the higher-level functions would
return garbage.  The nearby encryption code already handled errors
similarly.

Author: Peter Eisentraut <[email protected]>
Reviewed-by: Daniel Gustafsson <[email protected]>
Discussion: https://www.postgresql.org/message-id/[email protected]
Backpatch-through: 9.6
danielgustafsson authored and mrdrivingduck committed Mar 9, 2024
commit fac2d3c219bba4aaf98da737c650a6da937d3177
5 changes: 4 additions & 1 deletion contrib/pgcrypto/px.c
Original file line number Diff line number Diff line change
@@ -300,6 +300,7 @@ static int
combo_decrypt(PX_Combo *cx, const uint8 *data, unsigned dlen,
uint8 *res, unsigned *rlen)
{
int err = 0;
unsigned bs,
i,
pad;
@@ -325,7 +326,9 @@ combo_decrypt(PX_Combo *cx, const uint8 *data, unsigned dlen,

/* decrypt */
*rlen = dlen;
px_cipher_decrypt(c, data, dlen, res);
err = px_cipher_decrypt(c, data, dlen, res);
if (err)
return err;

/* unpad */
if (bs > 1 && cx->padding)