Re: Move OpenSSL random under USE_OPENSSL_RANDOM - Mailing list pgsql-hackers

From Daniel Gustafsson
Subject Re: Move OpenSSL random under USE_OPENSSL_RANDOM
Date
Msg-id 8D9C19AD-674D-4FD2-820E-9B429053719E@yesql.se
Whole thread Raw
In response to Re: Move OpenSSL random under USE_OPENSSL_RANDOM  (Michael Paquier <michael@paquier.xyz>)
Responses Re: Move OpenSSL random under USE_OPENSSL_RANDOM
List pgsql-hackers
> 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


Attachment

pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: Move OpenSSL random under USE_OPENSSL_RANDOM
Next
From: "Hou, Zhijie"
Date:
Subject: RE: Parallel copy