Re: Support for NSS as a libpq TLS backend

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: Jacob Champion <pchampion(at)vmware(dot)com>
Cc: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, Andres Freund <andres(at)anarazel(dot)de>, Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Michael Paquier <michael(at)paquier(dot)xyz>, Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Subject: Re: Support for NSS as a libpq TLS backend
Date: 2021-01-19 20:23:50
Message-ID: 4C8D62D3-92C4-42EA-8102-7F24E3F8D6A2@yesql.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 4 Dec 2020, at 01:57, Jacob Champion <pchampion(at)vmware(dot)com> wrote:
>
> On Nov 17, 2020, at 7:00 AM, Daniel Gustafsson <daniel(at)yesql(dot)se> wrote:
>>
>> Nice, thanks for the fix! I've incorporated your patch into the attached v20
>> which also fixes client side error reporting to be more readable.
>
> I was testing handshake failure modes and noticed that some FATAL
> messages are being sent through to the client in cleartext. The OpenSSL
> implementation doesn't do this, because it logs handshake problems at
> COMMERROR level. Should we switch all those ereport() calls in the NSS
> be_tls_open_server() to COMMERROR as well (and return explicitly), to
> avoid this? Or was there a reason for logging at FATAL/ERROR level?

The ERROR logging made early development easier but then stuck around, I've
changed them to COMMERROR returning an error instead in the v21 patch just
sent to the list.

> Related note, at the end of be_tls_open_server():
>
>> ...
>> port->ssl_in_use = true;
>> return 0;
>>
>> error:
>> return 1;
>> }
>
> This needs to return -1 in the error case; the only caller of
> secure_open_server() does a direct `result == -1` comparison rather than
> checking `result != 0`.

Fixed.

cheers ./daniel

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message John Naylor 2021-01-19 20:44:47 Re: WIP: BRIN multi-range indexes
Previous Message Daniel Gustafsson 2021-01-19 20:21:41 Re: Support for NSS as a libpq TLS backend