Re: BUG #16476: pgp_sym_encrypt_bytea with compress-level=6 : Wrong key or corrupt data
Jeff Janes <jeff.janes@gmail.com>
From: Jeff Janes <jeff.janes@gmail.com>
To: frank.gagnepain@intm.fr, pgsql-bugs <pgsql-bugs@lists.postgresql.org>
Date: 2020-06-03T12:35:02Z
Lists: pgsql-bugs
Attachments
- pgcrypto_zip.pl (application/octet-stream)
> select > > pgp_sym_decrypt_bytea(pgp_sym_encrypt_bytea(bytea_import(DATA),'password','compress-algo=1, > cipher-algo=aes256, compress-level=6'),'password','compress-algo=1, > cipher-algo=aes256'); > > decryption reads the settings from the encrypted message header, there is no need to specify them again. I can reproduce this at any compression level if the data is random (not compressible) and exactly 16365 bytes long. If the data is compressible, then you need a longer length of message to reproduce it and it depends on the random content and compression level. I'm attaching the reproducer as a Perl script. I have not investigated the C code of pgcrypto itself. Cheers, Jeff
Commits
-
Fix corner case with 16kB-long decompression in pgcrypto, take 2
- aaa132a65deb 9.5.23 landed
- 8a60f541f3e4 9.6.19 landed
- 9729f99798af 10.14 landed
- 202fc4ca531e 11.9 landed
- 5bd087eb5d77 12.4 landed
- 0caf1fc6e86a 13.0 landed
- a3ab7a707d9e 14.0 landed
-
Fix ancient violation of zlib's API spec.
- d0519e9fea96 9.5.23 landed
- ccf964a80100 9.6.19 landed
- d8ec3b1263d2 10.14 landed
- 475c69c97662 11.9 landed
- 3d4a778152ec 12.4 landed
- b9b610577d7f 14.0 landed
- 7dab4569d193 13.0 landed
-
Revert "Fix corner case with PGP decompression in pgcrypto"
- 43e21fd8f6e8 9.5.23 landed
- 11c320dcebc0 9.6.19 landed
- 9a3c895084c6 10.14 landed
- 6ae2d925b131 11.9 landed
- e30a63f258f5 12.4 landed
- 9f5162ef43c5 13.0 landed
- 38f60f174e32 14.0 landed
-
Fix corner case with PGP decompression in pgcrypto
- dbf17ca1bfab 9.5.23 landed
- e0cb8282d614 9.6.19 landed
- 5bfd0936b460 10.14 landed
- eceb415c6ff0 11.9 landed
- bba2e66aec4c 12.4 landed
- 35e142202b14 13.0 landed
- 9e108984fb35 14.0 landed