Re: pgcrypto: PGP armor headers

From: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
To: Marko Tiikkaja <marko(at)joh(dot)to>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pgcrypto: PGP armor headers
Date: 2014-10-01 11:01:33
Message-ID: 542BDF0D.4000901@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 10/01/2014 11:58 AM, Marko Tiikkaja wrote:
> On 10/1/14, 9:11 AM, Heikki Linnakangas wrote:
>> We have two options:
>>
>> 1. Throw an error if there are any non-ASCII characters in the key/value
>> arrays.
>> 2. Don't convert them to UTF-8, but use the current database encoding.
>>
>> Both seem sane to me. If we use the current database encoding, then we
>> have to also decide what to do with the input, in pgp_armor_headers().
>> If armor() uses the database encoding, but pgp_armor_headers() treats
>> the input as UTF-8, then a round-trip with pgp_armor_headers(armor(?))
>> won't work.
>
> Yeah. Both options seem fine to me. Throwing an error perhaps slightly
> more so.

I went with 1, throw an error. I also added checks that the key or value
doesn't contain any embedded newlines, and that the key doesn't contain
an embedded ": ". Those would cause the armor to be invalid.

I think this is now ready for commit, but since I've changed it quite
significantly from what you originally submitted, please take a moment
to review this.

- Heikki

Attachment Content-Type Size
pgcrypto_armor_headers.v7.patch text/x-diff 31.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2014-10-01 11:23:34 Re: "Value locking" Wiki page
Previous Message Andres Freund 2014-10-01 11:00:55 Re: test_shm_mq failing on anole (was: Sending out a request for more buildfarm animals?)