Re: BUG #11905: "Error: Wrong key or corrupt data" with pgp_sym_decrypt when bytea size is 2^x - 6 where x >=14

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Marko Tiikkaja <marko(at)joh(dot)to>
Cc: connor(dot)penhale(at)openlogic(dot)com, Pg Bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #11905: "Error: Wrong key or corrupt data" with pgp_sym_decrypt when bytea size is 2^x - 6 where x >=14
Date: 2014-11-11 20:33:39
Message-ID: CAMkU=1yA1rMhmfMvZ5e6pKCR1TCWF6Jd5XeeWz5aEcg+AL7PPg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tue, Nov 11, 2014 at 10:11 AM, Marko Tiikkaja <marko(at)joh(dot)to> wrote:

> On 2014-11-11 18:52, Jeff Janes wrote:
>
>> 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.
>>
>
> This sounds a lot like another bug I've seen. Can you try this patch?
>

That fixes it. I've tested all lengths from 1 to 133,000

I've added a regression test to it, in the attached.

How do we go about incorporating it, as far as bumping the extension
version-number and such? Or does it not get bumped at all because there is
no change to the interface?

Cheers,

Jeff

Attachment Content-Type Size
pgcrypto_bug_11905.patch application/octet-stream 1.8 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2014-11-11 20:59:30 Re: BUG #11939: Missing "actual time" in auto_explain plans
Previous Message Marko Tiikkaja 2014-11-11 18:11:20 Re: BUG #11905: "Error: Wrong key or corrupt data" with pgp_sym_decrypt when bytea size is 2^x - 6 where x >=14