Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1keQlg-0004p4-QR for pgsql-hackers@arkaria.postgresql.org; Sun, 15 Nov 2020 22:45:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1keQlf-0000Sf-P6 for pgsql-hackers@arkaria.postgresql.org; Sun, 15 Nov 2020 22:45:07 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1keQlf-0000SU-I8 for pgsql-hackers@lists.postgresql.org; Sun, 15 Nov 2020 22:45:07 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1keQlc-000832-2i for pgsql-hackers@lists.postgresql.org; Sun, 15 Nov 2020 22:45:06 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 0AFHGunH632624; Sun, 15 Nov 2020 12:16:57 -0500 From: Tom Lane To: Magnus Hagander cc: Daniel Gustafsson , Michael Paquier , Postgres hackers Subject: Re: Move OpenSSL random under USE_OPENSSL_RANDOM In-reply-to: References: <666524FF-D807-4687-BBAA-E49A76F06239@yesql.se> <20201104010114.GA1711@paquier.xyz> <20201105034413.GE1632@paquier.xyz> <20201105121253.GA17513@paquier.xyz> <7001EB35-BF76-4DEA-A7AB-CA94BCAA64E3@yesql.se> <20201105122834.GB17513@paquier.xyz> <8D9C19AD-674D-4FD2-820E-9B429053719E@yesql.se> <20201105233632.GA21123@paquier.xyz> <53D01523-A458-4FC6-83F1-8A16266F54A0@yesql.se> Comments: In-reply-to Magnus Hagander message dated "Fri, 06 Nov 2020 13:31:44 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <632622.1605460616.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sun, 15 Nov 2020 12:16:56 -0500 Message-ID: <632623.1605460616@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Magnus Hagander 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\sr= c\port\pg_strong_random.c(96,11): warning C4013: 'RAND_poll' undefined; as= suming extern returning int [C:\prog\bf\root\HEAD\pgsql.build\postgres.vcx= proj] drongo | 2020-11-15 06:59:05 | C:\prog\bf\root\HEAD\pgsql.build\sr= c\port\pg_strong_random.c(96,11): warning C4013: 'RAND_poll' undefined; as= suming extern returning int [C:\prog\bf\root\HEAD\pgsql.build\libpgport.vc= xproj] 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.v= cxproj] 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