pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Magnus Hagander <magnus@hagander.net>
Cc: Daniel Gustafsson <daniel@yesql.se>
Cc: Postgres hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: Move OpenSSL random under USE_OPENSSL_RANDOM
Date: Tue, 3 Nov 2020 19:35:18 +0900
Message-ID: <20201103103518.GC2298@paquier.xyz> (raw)
In-Reply-To: <CABUevEzJto1k2R_2fYHUMc=bFRPn6EFXrGkSj9UGpacXaBtCdg@mail.gmail.com>
References: <F6291C3C-747C-4C93-BCE0-28BB420B1FF5@yesql.se>
	<20200826075659.GI2017@paquier.xyz>
	<D86E0846-6730-442A-9846-B1FB9F1369FE@yesql.se>
	<CABUevEzJto1k2R_2fYHUMc=bFRPn6EFXrGkSj9UGpacXaBtCdg@mail.gmail.com>

On Tue, Nov 03, 2020 at 10:15:48AM +0100, Magnus Hagander wrote:
> On Wed, Aug 26, 2020 at 2:19 PM Daniel Gustafsson <daniel@yesql.se> wrote:
>> That's certainly true.  The intention though is to make the code easier to
>> follow (more explicit/discoverable) for anyone trying to implement support for
> 
> Is it really a reasonable usecase to use RAND_bytes() outside of both
> pg_stroing_random() *and' outside of the openssl-specific files (like
> be-secure-openssl.c)? Because it would only be those cases that would
> have this case, right?

It does not sound that strange to me to assume if some out-of-core
code makes use of that to fetch a random set of bytes.  Now I don't
know of any code doing that.  Who knows.

> If anything, perhaps the call to RAND_poll() in fork_process.c should
> actually be a call to a strong_random_initialize() or something which
> would have an implementation in pg_strong_random.c, thereby isolating
> the openssl specific code in there? (And with a void implementation
> without openssl)

I don't think that we have any need to go to such extent just for this
case, as RAND_poll() after forking a process is irrelevant in 1.1.1.
We are still many years away from removing its support though.

No idea if other SSL implementations would require such a thing.
Daniel, what about NSS?
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (38+ messages)  latest in thread

Message-ID: <20201103103518.GC2298@paquier.xyz>
Permalink:  ../20201103103518.GC2298@paquier.xyz/
Also on:    postgresql.org/message-id/20201103103518.GC2298@paquier.xyz

 · 

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: michael@paquier.xyz, magnus@hagander.net, daniel@yesql.se
  Subject: Re: Move OpenSSL random under USE_OPENSSL_RANDOM
  In-Reply-To: <20201103103518.GC2298@paquier.xyz>
  References: <F6291C3C-747C-4C93-BCE0-28BB420B1FF5@yesql.se> <20200826075659.GI2017@paquier.xyz> <D86E0846-6730-442A-9846-B1FB9F1369FE@yesql.se> <CABUevEzJto1k2R_2fYHUMc=bFRPn6EFXrGkSj9UGpacXaBtCdg@mail.gmail.com> <20201103103518.GC2298@paquier.xyz>

* 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