Re: Possible problem with pgcrypto

From: Jan Wieck <jan(at)wi3ck(dot)info>
To: Marko Tiikkaja <marko(at)joh(dot)to>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Possible problem with pgcrypto
Date: 2015-02-05 19:15:52
Message-ID: 54D3C168.6050301@wi3ck.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 02/05/2015 01:18 PM, Marko Tiikkaja wrote:
> On 2/5/15 4:48 PM, Jan Wieck wrote:
>> What the script does is to encode a small string with pgp_sym_encrypt()
>> and then repeatedly try to decrypt it with different "wrong" passwords.
>> The expected error message for that is of course
>>
>> "Wrong key or corrupt data".
>>
>> Every now and then, I get a different error message. Things I've seen are:
>>
>> "Not text data"
>
> That's not unexpected; the check for whether the data is text or not
> appears to happen quite early in the process of decoding. So it's
> enough to get to that point without anything being obviously broken.

I suspected something like that.

>
> In addition to the two errors above, it doesn't appear to be too
> difficult to see PXE_MBUF_SHORT_READ, which would give you ERROR:
> Corrupt data. I wonder why that error message is different, though.

From reading the code as far I did, I expected to see that, but haven't
seen it yet.

>
>> "pgcrypto bug"
>
> That doesn't look too good, but I can't reproduce it against 9.3.6 either.

Let me improve the script to a point where it can run for a long time in
the background and collect all different error cases as examples of
encrypted data and wrong password.

Thanks so far.
Jan

--
Jan Wieck
Senior Software Engineer
http://slony.info

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2015-02-05 19:41:56 Re: s_lock.h default definitions are rather confused
Previous Message Michael Paquier 2015-02-05 19:15:33 Re: [REVIEW] Re: Compression of full-page-writes