PostgreSQL Bugs

Collected from the PG bugs email list.

Bug ID16476
PG Version10.13
OSDebian 10
Opened2020-06-03 07:41:21+00
Reported byFrank Gagnepain
StatusNew

Body of first available message related to this bug follows.

The following bug has been logged on the website:

Bug reference:      16476
Logged by:          Frank Gagnepain
Email address:      (redacted)
PostgreSQL version: 10.13
Operating system:   Debian 10
Description:        

Hello to the support team,

I already sent a bug report for this issue, but PostgreSQL version was
9.4.21 which isnt supported anymore
So we tested this bug with a 10.13 PostgreSQL version this time and we got
the exact same issue.

I get "ERROR:  Wrong key or corrupt data" when using successively function
pgp_sym_encrypt_bytea and pgp_sym_decrypt_bytea on only some bytea data in
db with those options :
compress-algo=1 (ZIP algo)
cipher-algo=aes256
compress-level=6 (which is the default compress-level)
With any other value for compress-level (0,1,2,3,4,5,7,8,9) for
pgp_sym_encrypt_bytea, i get no error with pgp_sym_decrypt_bytea...


Here is what i do to test this error :


create or replace function bytea_import(p_path text, p_result out bytea)
language plpgsql as $$
declare
l_oid oid;
r record;
begin
p_result := '';
select lo_import(p_path) into l_oid;
for r in ( select data
from pg_largeobject
where loid = l_oid
order by pageno ) loop
p_result = p_result || r.data;
end loop;
perform lo_unlink(l_oid);
end;$$;


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');


ERROR:  Wrong key or corrupt data


Unfortunately i cant post any example of DATA since those are supposed to
be
sensitive data.
Nevertheless, does this kind of error rings a bell to anyone ?

Messages

DateAuthorSubject
2020-06-03 07:41:21+00PG Bug reporting formBUG #16476: pgp_sym_encrypt_bytea with compress-level=6 : Wrong key or corrupt data
2020-06-03 12:35:02+00Jeff JanesRe: BUG #16476: pgp_sym_encrypt_bytea with compress-level=6 : Wrong key or corrupt data
2020-06-10 15:17:51+00Frank GagnepainRE: BUG #16476: pgp_sym_encrypt_bytea with compress-level=6 : Wrong key or corrupt data
2020-06-11 11:58:31+00Kyotaro HoriguchiRe: BUG #16476: pgp_sym_encrypt_bytea with compress-level=6 : Wrong key or corrupt data
2020-06-11 13:17:26+00Kyotaro HoriguchiRe: BUG #16476: pgp_sym_encrypt_bytea with compress-level=6 : Wrong key or corrupt data
2020-06-12 01:51:31+00Kyotaro HoriguchiRe: BUG #16476: pgp_sym_encrypt_bytea with compress-level=6 : Wrong key or corrupt data
2020-06-12 01:57:25+00Tom LaneRe: BUG #16476: pgp_sym_encrypt_bytea with compress-level=6 : Wrong key or corrupt data
2020-06-12 05:54:12+00Kyotaro HoriguchiRe: BUG #16476: pgp_sym_encrypt_bytea with compress-level=6 : Wrong key or corrupt data
2020-06-24 07:59:21+00Michael PaquierRe: BUG #16476: pgp_sym_encrypt_bytea with compress-level=6 : Wrong key or corrupt data
2020-06-25 06:45:41+00Michael PaquierRe: BUG #16476: pgp_sym_encrypt_bytea with compress-level=6 : Wrong key or corrupt data
2020-07-07 06:07:22+00Michael PaquierRe: BUG #16476: pgp_sym_encrypt_bytea with compress-level=6 : Wrong key or corrupt data
2020-07-22 06:51:12+00Michael PaquierRe: BUG #16476: pgp_sym_encrypt_bytea with compress-level=6 : Wrong key or corrupt data
2020-07-22 08:45:54+00Kyotaro HoriguchiRe: BUG #16476: pgp_sym_encrypt_bytea with compress-level=6 : Wrong key or corrupt data
2020-07-22 09:37:49+00Michael PaquierRe: BUG #16476: pgp_sym_encrypt_bytea with compress-level=6 : Wrong key or corrupt data
2020-07-22 14:39:43+00Tom LaneRe: BUG #16476: pgp_sym_encrypt_bytea with compress-level=6 : Wrong key or corrupt data
2020-07-22 22:38:50+00Tom LaneRe: BUG #16476: pgp_sym_encrypt_bytea with compress-level=6 : Wrong key or corrupt data
2020-07-22 23:16:39+00Michael PaquierRe: BUG #16476: pgp_sym_encrypt_bytea with compress-level=6 : Wrong key or corrupt data
2020-07-22 23:25:40+00Mark WongRe: BUG #16476: pgp_sym_encrypt_bytea with compress-level=6 : Wrong key or corrupt data
2020-07-22 23:36:55+00Michael PaquierRe: BUG #16476: pgp_sym_encrypt_bytea with compress-level=6 : Wrong key or corrupt data
2020-07-23 19:38:43+00Tom LaneRe: BUG #16476: pgp_sym_encrypt_bytea with compress-level=6 : Wrong key or corrupt data
2020-07-27 07:16:35+00Michael PaquierRe: BUG #16476: pgp_sym_encrypt_bytea with compress-level=6 : Wrong key or corrupt data