Re: Move OpenSSL random under USE_OPENSSL_RANDOM

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: Michael Paquier <michael(at)paquier(dot)xyz>
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:25:44
Message-ID: 046888F1-FCBC-4685-9660-A7BCA65A8F44@yesql.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 18 Nov 2020, at 02:31, Michael Paquier <michael(at)paquier(dot)xyz> wrote:
>
> On Tue, Nov 17, 2020 at 09:24:30PM +0100, Daniel Gustafsson wrote:
>> I tend to agree, randomness is complicated enough without adding a compile time
>> extensibility which few (if anyone) will ever use. Attached is an attempt at
>> this.
>
> Going down to that, it seems to me that we could just remove
> USE_WIN32_RANDOM (as this is implied by WIN32), as well as
> USE_DEV_URANDOM because configure.ac checks for the existence of
> /dev/urandom, no? In short, configure.ac could be changed to check
> after /dev/urandom if not using OpenSSL and not being on Windows.

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).

> -elif test x"$USE_WIN32_RANDOM" = x"1" ; then
> +elif test x"$PORTANME" = x"win32" ; then
> Typo here, s/PORTANME/PORTNAME.

Fixed.

cheers ./daniel

Attachment Content-Type Size
v2-0001-Remove-ability-to-choose-randomness-source.patch application/octet-stream 8.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2020-11-18 08:32:03 Re: [patch] [doc] Clarify that signal functions have no feedback
Previous Message Michael Paquier 2020-11-18 08:06:48 Re: ResourceOwner refactoring