pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jacob Champion <pchampion@vmware.com>
To: daniel@yesql.se <daniel@yesql.se>
Cc: pgsql-hackers@lists.postgresql.org <pgsql-hackers@lists.postgresql.org>
Cc: andrew@dunslane.net <andrew@dunslane.net>
Subject: Re: [PATCH] test/ssl: rework the sslfiles Makefile target
Date: Wed, 28 Jul 2021 20:10:53 +0000
Message-ID: <ffce081b30b0d3303c788471f30171b4074fbb9f.camel@vmware.com> (raw)
In-Reply-To: <223071F9-618F-48AF-BE40-EFF76F5CE45F@yesql.se>
References: <d15a9838344ba090e09fd866abf913584ea19fb7.camel@vmware.com>
	<223071F9-618F-48AF-BE40-EFF76F5CE45F@yesql.se>

On Wed, 2021-07-28 at 00:24 +0200, Daniel Gustafsson wrote:
> > On 4 Mar 2021, at 01:03, Jacob Champion <pchampion@vmware.com> wrote:
> > Andrew pointed out elsewhere [1] that it's pretty difficult to add new
> > certificates to the test/ssl suite without blowing away the current
> > state and starting over. I needed new cases for the NSS backend work,
> > and ran into the same pain, so here is my attempt to improve the
> > situation.
> 
> Thanks for working on this, I second the pain cited.  I've just started to look
> at this, so only a few comments thus far.
> 
> > The unused server-ss certificate has been removed entirely.
> 
> Nice catch, this seems to have been unused since the original import of the SSL
> test suite.  To cut down scope of the patch (even if only a small bit) I
> propose to apply this separately first, as per the attached.

LGTM.

> > - Serial number collisions are less likely, thanks to Andrew's idea to
> > use the current clock time as the initial serial number in a series.
> 
> +my $serialno = `openssl x509 -serial -noout -in ssl/client.crt`;
> +$serialno =~ s/^serial=//;
> +$serialno = hex($serialno); # OpenSSL prints serial numbers in hexadecimal
> 
> Will that work on Windows?  We don't currently require the openssl binary to be
> in PATH unless one wants to rebuild sslfiles (which it is quite likely to be
> but there should at least be errorhandling covering when it's not).

Hm, that's a good point. It should be easy enough for me to add a
fallback if the invocation fails; I'll give it a shot tomorrow.

> > - I am making _heavy_ use of GNU Make-isms, which does not improve
> > long-term maintainability.
> 
> GNU Make is already a requirement, I don't see this shifting the needle in any
> direction.

As long as the .SECONDARYEXPANSION magic is clear enough to others, I'm
happy.

Thanks!
--Jacob


view thread (31+ messages)  latest in thread

Message-ID: <ffce081b30b0d3303c788471f30171b4074fbb9f.camel@vmware.com>
Permalink:  ../ffce081b30b0d3303c788471f30171b4074fbb9f.camel@vmware.com/
Also on:    postgresql.org/message-id/ffce081b30b0d3303c788471f30171b4074fbb9f.camel@vmware.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-hackers@postgresql.org
  Cc: pchampion@vmware.com, daniel@yesql.se, andrew@dunslane.net
  Subject: Re: [PATCH] test/ssl: rework the sslfiles Makefile target
  In-Reply-To: <ffce081b30b0d3303c788471f30171b4074fbb9f.camel@vmware.com>
  References: <d15a9838344ba090e09fd866abf913584ea19fb7.camel@vmware.com> <223071F9-618F-48AF-BE40-EFF76F5CE45F@yesql.se> <ffce081b30b0d3303c788471f30171b4074fbb9f.camel@vmware.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