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 8293CD7B-D36B-4E82-B876-5BD5980A77CE@yesql.se
Whole thread Raw
In response to Re: Move OpenSSL random under USE_OPENSSL_RANDOM  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers
> On 19 Nov 2020, at 04:34, Michael Paquier <michael@paquier.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.

Ok.  I would add a strongly worded comment about the importance of the ordering
since that is now crucial not to break.

-#ifdef USE_WIN32_RANDOM
+#ifdef WIN32
 #include <wincrypt.h>
 #endif

-#ifdef USE_WIN32_RANDOM
+#ifdef WIN32
 /*
  * Cache a global crypto provider that only gets freed when the process
  * exits, in case we need random numbers more than once.
@@ -39,7 +39,7 @@
 static HCRYPTPROV hProvider = 0;
 #endif

This will pull in headers and define hProvider for all Windows builds even if
they use OpenSSL, but perhaps that doesn't matter?

cheers ./daniel


pgsql-hackers by date:

Previous
From: Ajin Cherian
Date:
Subject: Re: [HACKERS] logical decoding of two-phase transactions
Next
From: Julien Rouhaud
Date:
Subject: Re: ResourceOwner refactoring