pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Michael Paquier <michael.paquier@gmail.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Thomas Munro <thomas.munro@enterprisedb.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: pgsql: Implement channel binding tls-server-end-point for SCRAM
Date: Fri, 5 Jan 2018 09:56:37 -0500
Message-ID: <517b2640-dfea-ca7f-220c-1d4f482f6fc4@2ndquadrant.com> (raw)
In-Reply-To: <CAB7nPqShHkb+RXEkXfP5XV2dYt6zHhzkeWLVtW=exHa+aDgV8g@mail.gmail.com>
References: <E1eXCFl-00009k-0q@gemulon.postgresql.org>
	<CAEepm=1=gdkngdgkSHiRSkDGWqSrWQNxYSKSc-2yP3cfSXxT_A@mail.gmail.com>
	<CA+TgmoYx8bw839UYnw1fCnsXHhHcGWZCgR6Fd-=yTn4Kw7Bejg@mail.gmail.com>
	<CAB7nPqShHkb+RXEkXfP5XV2dYt6zHhzkeWLVtW=exHa+aDgV8g@mail.gmail.com>

On 1/5/18 09:28, Michael Paquier wrote:
> In order to do things cleanly, we should make this TAP test
> conditional on the version of OpenSSL.

How about looking into pg_config.h, like in the attached patch?

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachments:

0001-Fix-ssl-tests-for-when-tls-server-end-point-is-not-s.patch (text/plain, 1.9K) download From d1c309a4c07c47f06650fd8231938e1eaed1342e Mon Sep 17 00:00:00 2001 From: Peter Eisentraut <peter_e@gmx.net> Date: Fri, 5 Jan 2018 09:55:01 -0500 Subject: [PATCH] Fix ssl tests for when tls-server-end-point is not supported --- src/test/ssl/t/002_scram.pl | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/test/ssl/t/002_scram.pl b/src/test/ssl/t/002_scram.pl index 3f425e00f0..92b84e1565 100644 --- a/src/test/ssl/t/002_scram.pl +++ b/src/test/ssl/t/002_scram.pl @@ -11,6 +11,11 @@ # This is the hostname used to connect to the server. my $SERVERHOSTADDR = '127.0.0.1'; +# Determine whether build supports tls-server-end-point. +open my $pg_config_h, '<', '../../include/pg_config.h' or die "$!"; +my $supports_tls_server_end_point = (grep {/^#define HAVE_X509_GET_SIGNATURE_NID 1/} <$pg_config_h>); +close $pg_config_h; + # Allocation of base connection string shared among multiple tests. my $common_connstr; @@ -44,10 +49,19 @@ "SCRAM authentication with tls-unique as channel binding"); test_connect_ok($common_connstr, "scram_channel_binding=''", - "SCRAM authentication without channel binding"); -test_connect_ok($common_connstr, - "scram_channel_binding=tls-server-end-point", - "SCRAM authentication with tls-server-end-point as channel binding"); + "SCRAM authentication without channel binding"); +if ($supports_tls_server_end_point) +{ + test_connect_ok($common_connstr, + "scram_channel_binding=tls-server-end-point", + "SCRAM authentication with tls-server-end-point as channel binding"); +} +else +{ + test_connect_fails($common_connstr, + "scram_channel_binding=tls-server-end-point", + "SCRAM authentication with tls-server-end-point as channel binding"); +} test_connect_fails($common_connstr, "scram_channel_binding=not-exists", "SCRAM authentication with invalid channel binding"); -- 2.15.1

view thread (12+ messages)  latest in thread

Message-ID: <517b2640-dfea-ca7f-220c-1d4f482f6fc4@2ndquadrant.com>
Permalink:  ../517b2640-dfea-ca7f-220c-1d4f482f6fc4@2ndquadrant.com/
Also on:    postgresql.org/message-id/517b2640-dfea-ca7f-220c-1d4f482f6fc4@2ndquadrant.com

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: peter.eisentraut@2ndquadrant.com, michael.paquier@gmail.com, robertmhaas@gmail.com, thomas.munro@enterprisedb.com, pgsql-hackers@postgresql.org
  Subject: Re: pgsql: Implement channel binding tls-server-end-point for SCRAM
  In-Reply-To: <517b2640-dfea-ca7f-220c-1d4f482f6fc4@2ndquadrant.com>
  References: <E1eXCFl-00009k-0q@gemulon.postgresql.org> <CAEepm=1=gdkngdgkSHiRSkDGWqSrWQNxYSKSc-2yP3cfSXxT_A@mail.gmail.com> <CA+TgmoYx8bw839UYnw1fCnsXHhHcGWZCgR6Fd-=yTn4Kw7Bejg@mail.gmail.com> <CAB7nPqShHkb+RXEkXfP5XV2dYt6zHhzkeWLVtW=exHa+aDgV8g@mail.gmail.com> <517b2640-dfea-ca7f-220c-1d4f482f6fc4@2ndquadrant.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox