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

From Marko Tiikkaja
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
Msg-id 54625148.2060105@joh.to
Whole thread Raw
In response to Re: BUG #11905: "Error: Wrong key or corrupt data" with pgp_sym_decrypt when bytea size is 2^x - 6 where x >=14  (Jeff Janes <jeff.janes@gmail.com>)
Responses Re: BUG #11905: "Error: Wrong key or corrupt data" with pgp_sym_decrypt when bytea size is 2^x - 6 where x >=14
List pgsql-bugs
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?

*** a/contrib/pgcrypto/pgp-decrypt.c
--- b/contrib/pgcrypto/pgp-decrypt.c
***************
*** 182,188 **** pktreader_pull(void *priv, PullFilter *src, int len,
       if (pkt->type == PKT_CONTEXT)
           return pullf_read(src, len, data_p);

!     if (pkt->len == 0)
       {
           /* this was last chunk in stream */
           if (pkt->type == PKT_NORMAL)
--- 182,188 ----
       if (pkt->type == PKT_CONTEXT)
           return pullf_read(src, len, data_p);

!     while (pkt->len == 0)
       {
           /* this was last chunk in stream */
           if (pkt->type == PKT_NORMAL)



.marko

pgsql-bugs by date:

Previous
From: Jeff Janes
Date:
Subject: Re: BUG #11905: "Error: Wrong key or corrupt data" with pgp_sym_decrypt when bytea size is 2^x - 6 where x >=14
Next
From: robert.wysocki@essencedigital.com
Date:
Subject: BUG #11939: Missing "actual time" in auto_explain plans