Re: Move OpenSSL random under USE_OPENSSL_RANDOM

Daniel Gustafsson <daniel@yesql.se>

From: Daniel Gustafsson <daniel@yesql.se>
To: Michael Paquier <michael@paquier.xyz>
Cc: Magnus Hagander <magnus@hagander.net>, Postgres hackers <pgsql-hackers@lists.postgresql.org>
Date: 2020-11-05T12:59:11Z
Lists: pgsql-hackers

Attachments

> On 5 Nov 2020, at 13:28, Michael Paquier <michael@paquier.xyz> wrote:

> It seems to me that this one would become incorrect if compiling with
> OpenSSL but select a random source that requires an initialization, as
> it would enforce only OpenSSL initialization all the time.

Right, how about something like the attached (untested) diff?

> Theoretical point now, of course, because such combination does not
> exist yet in the code.

Not yet, and potentially never will.  Given the consequences of a PRNG which
hasn't been properly initialized I think it's ok to be defensive in this
codepath however.

cheers ./daniel

Commits

  1. Remove ability to independently select random number generator

  2. Add pg_strong_random_init function to initialize random number generator