Re: Missing include in be-secure-openssl.c? - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Missing include in be-secure-openssl.c?
Date
Msg-id YX96r7i6h8JXOKD5@paquier.xyz
Whole thread Raw
In response to Missing include in be-secure-openssl.c?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Missing include in be-secure-openssl.c?
List pgsql-hackers
On Sun, Oct 31, 2021 at 06:45:47PM -0400, Tom Lane wrote:
> I observe that the OpenSSL docs say you are supposed to
> #include <openssl/x509.h>
> when using these functions.  We are including that header in
> some other modules, but not here.  I speculate that we've gotten
> away with that so far because of indirect inclusions; but hamerkop
> must be running an OpenSSL version that has rearranged the headers
> enough that that doesn't work anymore.  That machine was offline
> for awhile right before it started to fail, so it seems plausible
> that it was rebuilt with some pretty bleeding-edge OpenSSL version.

Hmm.  I have tested MSVC with 3.0.0 not so long ago, and this was
working, but maybe they upgraded from 1.0.2 to 3.0.0?  I'd be
surprised if this was broken in some way in one of the stable releases
as well.  We've had our share of surprises with OpenSSL when it comes
to major upgrades, but nothing that stood out when it came to minor
release compatibility and ABI, AFAIK.

> Anyway, I propose adding that #include.

openssl/ssl.h includes openssl/x509.h if OPENSSL_NO_DEPRECATED_1_1_0
is not defined, but agreed that adding the header makes sense here.

x509v3.h includes x509.h, so fe-secure-openssl.h would not need an
update.  Now could it be a better practice to include both there?
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Greg Nancarrow
Date:
Subject: Re: Added schema level support for publication.
Next
From: Andres Freund
Date:
Subject: Re: Use -fvisibility=hidden for shared libraries