Re: Move OpenSSL random under USE_OPENSSL_RANDOM

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Daniel Gustafsson <daniel(at)yesql(dot)se>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Magnus Hagander <magnus(at)hagander(dot)net>, Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Move OpenSSL random under USE_OPENSSL_RANDOM
Date: 2020-11-18 08:54:36
Message-ID: 20201118085436.GM19692@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Nov 18, 2020 at 09:25:44AM +0100, Daniel Gustafsson wrote:
> Technically that is what it does, except for setting the USE_*RANDOM variables
> for non-OpenSSL builds. We could skip that too, which I think is what you're
> proposing, but it seems to me that we'll end up with another set of entangled
> logic in pg_strong_random if we do since there then needs to be precedence in
> checking (one might be on Windows with OpenSSL for example, where OpenSSL >
> Windows API).

Yes, I am suggesting to just remove both USE_*_RANDOM flags, and use
the following structure instead in pg_strong_random.c for both the
init and main functions:
#ifdef USE_OPENSSL
/* foo */
#elif WIN32
/* bar*/
#else
/* hoge urandom */
#endif

And complain in configure.ac if we miss urandom for the fallback case.

Now, it would not be the first time I suggest something on this thread
that nobody likes :)
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message k.jamison@fujitsu.com 2020-11-18 09:04:49 RE: [Patch] Optimize dropping of relation buffers using dlist
Previous Message Peter Smith 2020-11-18 08:52:24 Re: [HACKERS] logical decoding of two-phase transactions