pgcrypto: Check for error return of px_cipher_decrypt()
authorPeter Eisentraut <peter@eisentraut.org>
Tue, 23 Mar 2021 10:35:12 +0000 (11:35 +0100)
committerPeter Eisentraut <peter@eisentraut.org>
Tue, 23 Mar 2021 10:48:37 +0000 (11:48 +0100)
commit22e1943f13b66df22ea4f8d15836411ba259263a
treeb22bcb0193b6eeec1fd3aa15e840fc83e71225bf
parenta6715af1e72da289474011be1e2d536f991eda34
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.

Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
Discussion: https://www.postgresql.org/message-id/9e9c431c-0adc-7a6d-9b1a-915de1ba3fe7@enterprisedb.com
contrib/pgcrypto/px.c