Loop when necessary in contrib/pgcrypto's pktreader_pull().
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 11 Nov 2014 22:22:15 +0000 (17:22 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 11 Nov 2014 22:22:38 +0000 (17:22 -0500)
commit419de696a76f5884e26ecd0905a084b0f57afc93
tree9888eda2de6b71ab459bc732ca22bba181e97e43
parent2a83e0349c222047af87cf54d4ca87764806c291
Loop when necessary in contrib/pgcrypto's pktreader_pull().

This fixes a scenario in which pgp_sym_decrypt() failed with "Wrong key
or corrupt data" on messages whose length is 6 less than a power of 2.

Per bug #11905 from Connor Penhale.  Fix by Marko Tiikkaja, regression
test case from Jeff Janes.
contrib/pgcrypto/expected/pgp-decrypt.out
contrib/pgcrypto/pgp-decrypt.c
contrib/pgcrypto/sql/pgp-decrypt.sql