diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2014-11-11 17:22:15 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2014-11-11 17:22:30 -0500 |
commit | 1c73485c695af2dfa7a7f7bec6e1ab8d4eaab7ab (patch) | |
tree | dfa453812d21f4efb60d40f3fa07d30215c1aa66 /contrib/pgcrypto/sql | |
parent | 951c2f6faf00a00ab824699c96376d1d8f5acc57 (diff) |
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.
Diffstat (limited to 'contrib/pgcrypto/sql')
-rw-r--r-- | contrib/pgcrypto/sql/pgp-decrypt.sql | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/contrib/pgcrypto/sql/pgp-decrypt.sql b/contrib/pgcrypto/sql/pgp-decrypt.sql index 93535ab016a..5457152ccf6 100644 --- a/contrib/pgcrypto/sql/pgp-decrypt.sql +++ b/contrib/pgcrypto/sql/pgp-decrypt.sql @@ -264,3 +264,7 @@ a3nsOzKTXUfS9VyaXo8IrncM6n7fdaXpwba/3tNsAhJG4lDv1k4g9v8Ix2dfv6Rs -----END PGP MESSAGE----- '), 'key', 'convert-crlf=1'), 'sha1'), 'hex'); -- expected: 7efefcab38467f7484d6fa43dc86cf5281bd78e2 + +-- check BUG #11905, problem with messages 6 less than a power of 2. +select pgp_sym_decrypt(pgp_sym_encrypt(repeat('x',65530),'1'),'1') = repeat('x',65530); +-- expected: true |