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

From Michael Paquier
Subject Re: Move OpenSSL random under USE_OPENSSL_RANDOM
Date
Msg-id 20201105034413.GE1632@paquier.xyz
Whole thread Raw
In response to Re: Move OpenSSL random under USE_OPENSSL_RANDOM  (Magnus Hagander <magnus@hagander.net>)
Responses Re: Move OpenSSL random under USE_OPENSSL_RANDOM  (Daniel Gustafsson <daniel@yesql.se>)
List pgsql-hackers
On Wed, Nov 04, 2020 at 10:05:48AM +0100, Magnus Hagander wrote:
> Yes, we should absolutely do that. We already do this for
> pg_strong_random() itself, and we should definitely repeat the pattern
> in the init function.

This poked at my curiosity, so I looked at it.  The result looks
indeed like an improvement to me, while taking care of the point of
upthread to make the implementation stuff controlled only by
USE_OPENSSL_RANDOM.  Per se the attached.

This could make random number generation predictible when an extension
calls directly RAND_bytes() if USE_OPENSSL_RANDOM is not used while
building with OpenSSL, but perhaps I am just too much of a pessimistic
nature.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: Transactions involving multiple postgres foreign servers, take 2
Next
From: David Pirotte
Date:
Subject: Re: Any objections to implementing LogicalDecodeMessageCB for pgoutput?