Re: Move OpenSSL random under USE_OPENSSL_RANDOM

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Daniel Gustafsson <daniel(at)yesql(dot)se>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Move OpenSSL random under USE_OPENSSL_RANDOM
Date: 2020-11-19 10:00:40
Message-ID: CABUevEwxaKcy9wXepCtQj2y2DTeC4sA1h4T3+UN6-o9vvOYcPA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Nov 19, 2020 at 4:34 AM Michael Paquier <michael(at)paquier(dot)xyz> wrote:
>
> On Wed, Nov 18, 2020 at 10:43:35AM +0100, Daniel Gustafsson wrote:
> > While it does simplify configure.ac, I'm just not a fan of the strict ordering
> > which is required without the labels even implying it. But that might just be
> > my personal preference.
>
> I just looked at that, and the attached seems more intuitive to me.
> There is more code removed, but not that much either.

First -- your patch mi9sses the comment in front of pg_strong_random
which still says configure will set the USE_*_RANDOM macros.

That said, I agree with daniel that it's a bit "scary" that it's the
order of ifdefs that now decide on the whole thing, especially since
there are two sets of those (one in the init function, one in the
random one), which could potentially end up out of order if someone
makes a mistake.

I'm thinking the code might get a lot cleaner if we just make a single
set of ifdefs, even if that means repeating the function header. In
theory we could put them in different *.c files as well, but that
seems overkill given how tiny they are.

Patch is the same as your v3 in all parts except for the
pg_strong_random.c changes.

In summary, here's my suggestion for color of the bikeshed.

--
Magnus Hagander
Me: https://www.hagander.net/
Work: https://www.redpill-linpro.com/

Attachment Content-Type Size
v4-Remove-ability-to-choose-randomness-source.patch application/x-patch 12.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message osumi.takamichi@fujitsu.com 2020-11-19 10:26:12 RE: Disable WAL logging to speed up data loading
Previous Message Dean Rasheed 2020-11-19 09:52:04 Re: Additional improvements to extended statistics