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

From Tom Lane
Subject Re: Move OpenSSL random under USE_OPENSSL_RANDOM
Date
Msg-id 632623.1605460616@sss.pgh.pa.us
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  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers
Magnus Hagander <magnus@hagander.net> writes:
> I think the defensive-in-code instead of defensive-in-docs is a really
> strong argument, so I have pushed it as such.

I notice warnings that I think are caused by this patch on some buildfarm
members, eg

 drongo        | 2020-11-15 06:59:05 | C:\prog\bf\root\HEAD\pgsql.build\src\port\pg_strong_random.c(96,11): warning
C4013:'RAND_poll' undefined; assuming extern returning int [C:\prog\bf\root\HEAD\pgsql.build\postgres.vcxproj] 
 drongo        | 2020-11-15 06:59:05 | C:\prog\bf\root\HEAD\pgsql.build\src\port\pg_strong_random.c(96,11): warning
C4013:'RAND_poll' undefined; assuming extern returning int [C:\prog\bf\root\HEAD\pgsql.build\libpgport.vcxproj] 
 drongo        | 2020-11-15 06:59:05 |   C:\prog\bf\root\HEAD\pgsql.build\src\port\pg_strong_random.c(96,11): warning
C4013:'RAND_poll' undefined; assuming extern returning int [C:\prog\bf\root\HEAD\pgsql.build\postgres.vcxproj] 
 drongo        | 2020-11-15 06:59:05 |   C:\prog\bf\root\HEAD\pgsql.build\src\port\pg_strong_random.c(96,11): warning
C4013:'RAND_poll' undefined; assuming extern returning int [C:\prog\bf\root\HEAD\pgsql.build\libpgport.vcxproj] 

(bowerbird and hamerkop are showing the same).

My first thought about it was that this bit is busted:

+#ifndef USE_OPENSSL
+   RAND_poll();
+#endif

The obvious problem with this is that if !USE_OPENSSL, we will not have
pulled in openssl's headers.

However ... all these machines are pointing at line 96, which is not
that one but the one under "#if defined(USE_OPENSSL)".  So I'm not sure
what to make of that, except that a bit more finesse seems required.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: Online checksums patch - once again
Next
From: Tomas Vondra
Date:
Subject: Re: list of extended statistics on psql