On Fri, Nov 7, 2014 at 1:56 PM, <connor.penhale@openlogic.com> wrote:
> The following bug has been logged on the website:
>
> Bug reference: 11905
> Logged by: Connor Penhale
> Email address: connor.penhale@openlogic.com
> PostgreSQL version: 9.3.1
> Operating system: OS X Yosemitie
> Description:
>
> Hello Postgres Community,
>
> When I attempt to decrypt a file I successfully encrypted with a size of
> 65530, I get the =E2=80=9CError: Wrong key or corrupt data=E2=80=9D messa=
ge.
>
...
> I=E2=80=99ve been able to reproduce this on Postgres 9.1 and 9.3.
>
I can reproduce this error, and first get it at a size of 16378 (i.e.
2^14-6).
I can reproduce it also against the development head code, including after
applying the recently proposed patch
http://www.postgresql.org/message-id/5454F3C2.608@joh.to
I can reproduce it easily with the single query:
select pgp_sym_decrypt(pgp_sym_encrypt(?,'I am the password'),'I am the
password','debug=3D1')
The problem is that mdc_read is getting invoked with an len argument of 0.
When it successfully reads 0 bytes, it interprets that as an error. I
can't figure out why it is getting invoked with a length of 0, too many
pointer indirections for me to follow at this time.
Cheers,
Jeff