postgresql/contrib/pgcrypto
Michael Paquier 9e108984fb Fix corner case with PGP decompression in pgcrypto
A compressed stream may end with an empty packet, and PGP decompression
finished before reading this empty packet in the remaining stream.  This
caused a failure in pgcrypto, handling this case as corrupted data.
This commit makes sure to consume such extra data, avoiding a failure
when decompression the entire stream.  This corner case was reproducible
with a data length of 16kB, and existed since its introduction in
e94dd6a.  A cheap regression test is added to cover this case.

Thanks to Jeff Janes for the extra investigation.

Reported-by: Frank Gagnepain
Author: Kyotaro Horiguchi, Michael Paquier
Discussion: https://postgr.es/m/16476-692ef7b84e5fb893@postgresql.org
Backpatch-through: 9.5
2020-07-22 14:52:23 +09:00
..
expected Fix corner case with PGP decompression in pgcrypto 2020-07-22 14:52:23 +09:00
sql Fix corner case with PGP decompression in pgcrypto 2020-07-22 14:52:23 +09:00
.gitignore
blf.c
blf.h
crypt-blowfish.c
crypt-des.c
crypt-gensalt.c
crypt-md5.c
imath.c
imath.h
internal-sha2.c
internal.c
Makefile
mbuf.c
mbuf.h
md5.c
md5.h
openssl.c
pgcrypto--1.0--1.1.sql
pgcrypto--1.1--1.2.sql
pgcrypto--1.2--1.3.sql
pgcrypto--1.3.sql
pgcrypto.c Make the order of the header file includes consistent in contrib modules. 2019-10-24 08:05:34 +05:30
pgcrypto.control
pgcrypto.h
pgp-armor.c
pgp-cfb.c
pgp-compress.c Fix corner case with PGP decompression in pgcrypto 2020-07-22 14:52:23 +09:00
pgp-decrypt.c
pgp-encrypt.c
pgp-info.c
pgp-mpi-internal.c
pgp-mpi-openssl.c Make the order of the header file includes consistent in contrib modules. 2019-10-24 08:05:34 +05:30
pgp-mpi.c
pgp-pgsql.c
pgp-pubdec.c
pgp-pubenc.c Make the order of the header file includes consistent in contrib modules. 2019-10-24 08:05:34 +05:30
pgp-pubkey.c
pgp-s2k.c
pgp.c
pgp.h Fix inconsistencies and typos in the tree, take 10 2019-08-13 13:53:41 +09:00
px-crypt.c
px-crypt.h
px-hmac.c
px.c
px.h
rijndael.c
rijndael.h
rijndael.tbl
sha1.c
sha1.h