diff options
author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2016-09-15 22:29:39 +0300 |
---|---|---|
committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2016-09-15 22:52:51 +0300 |
commit | 5c6df67e0c961f68e73e7c1e6312211ed59da00a (patch) | |
tree | 83959fc3c32e01bbdb2f4610efff86c0ab5c4c42 /src/backend/libpq/be-secure-openssl.c | |
parent | ffccee473682ed18a27d667b7a4f45d802dd61c4 (diff) | |
download | postgresql-5c6df67e0c961f68e73e7c1e6312211ed59da00a.tar.gz postgresql-5c6df67e0c961f68e73e7c1e6312211ed59da00a.zip |
Fix building with LibreSSL.
LibreSSL defines OPENSSL_VERSION_NUMBER to claim that it is version 2.0.0,
but it doesn't have the functions added in OpenSSL 1.1.0. Add autoconf
checks for the individual functions we need, and stop relying on
OPENSSL_VERSION_NUMBER.
Backport to 9.5 and 9.6, like the patch that broke this. In the
back-branches, there are still a few OPENSSL_VERSION_NUMBER checks left,
to check for OpenSSL 0.9.8 or 0.9.7. I left them as they were - LibreSSL
has all those functions, so they work as intended.
Per buildfarm member curculio.
Discussion: <2442.1473957669@sss.pgh.pa.us>
Diffstat (limited to 'src/backend/libpq/be-secure-openssl.c')
-rw-r--r-- | src/backend/libpq/be-secure-openssl.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/libpq/be-secure-openssl.c b/src/backend/libpq/be-secure-openssl.c index 2afd738945d..fedb02cd820 100644 --- a/src/backend/libpq/be-secure-openssl.c +++ b/src/backend/libpq/be-secure-openssl.c @@ -165,7 +165,7 @@ be_tls_init(void) if (!SSL_context) { -#if OPENSSL_VERSION_NUMBER >= 0x10100000L +#ifdef HAVE_OPENSSL_INIT_SSL OPENSSL_init_ssl(OPENSSL_INIT_LOAD_CONFIG, NULL); #else OPENSSL_config(NULL); @@ -672,7 +672,7 @@ be_tls_write(Port *port, void *ptr, size_t len, int *waitfor) * to retry; do we need to adopt their logic for that? */ -#if OPENSSL_VERSION_NUMBER < 0x10100000L +#ifndef HAVE_BIO_GET_DATA #define BIO_get_data(bio) (bio->ptr) #define BIO_set_data(bio, data) (bio->ptr = data) #endif @@ -726,7 +726,7 @@ my_BIO_s_socket(void) if (!my_bio_methods) { BIO_METHOD *biom = (BIO_METHOD *) BIO_s_socket(); -#if OPENSSL_VERSION_NUMBER >= 0x10100000L +#ifdef HAVE_BIO_METH_NEW int my_bio_index; my_bio_index = BIO_get_new_index(); |