pgsql: Fix SSL test for libpq connection parameter channel_binding - Mailing list pgsql-committers

From Michael Paquier
Subject pgsql: Fix SSL test for libpq connection parameter channel_binding
Date
Msg-id E1iEn3E-0007X3-JI@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Fix SSL test for libpq connection parameter channel_binding

When compiling Postgres with OpenSSL 1.0.1 or older versions, SCRAM's
channel binding cannot be supported as X509_get_signature_nid() is
needed, which causes a regression test with channel_binding='require' to
fail as the server cannot publish SCRAM-SHA-256-PLUS as SASL mechanism
over an SSL connection.

Fix the issue by using a method similar to c3d41cc, making the test
result conditional.  The test passes if X509_get_signature_nid() is
present, and when missing we test for a connection failure.  Testing a
connection failure is more useful than skipping the test as we should
fail the connection if channel binding is required by the client but the
server does not support it.

Reported-by: Tom Lane, Michael Paquier
Author: Michael Paquier
Discussion: https://postgr.es/m/20190927024457.GA8485@paquier.xyz
Discussion: https://postgr.es/m/24857.1569775891@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/a12c75a1048295f03cf85533d6dcab5072ba262b

Modified Files
--------------
src/test/ssl/t/002_scram.pl | 27 +++++++++++++++++++++------
1 file changed, 21 insertions(+), 6 deletions(-)


pgsql-committers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: pgsql: Add libpq parameter 'channel_binding'.
Next
From: Michael Paquier
Date:
Subject: Re: pgsql: Add libpq parameter 'channel_binding'.