From: Viktor Dukhovni Date: Sun, 10 Jan 2016 07:45:53 +0000 (-0500) Subject: Bitrot: 'SSLeay' function names purged from OpenSSL 1.1.0 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=09ca13368d90e7d2979879f2e50ea6a9b1907b41;p=thirdparty%2Fpostfix.git Bitrot: 'SSLeay' function names purged from OpenSSL 1.1.0 --- diff --git a/postfix/src/tls/tls.h b/postfix/src/tls/tls.h index b62174635..78348eabd 100644 --- a/postfix/src/tls/tls.h +++ b/postfix/src/tls/tls.h @@ -54,6 +54,11 @@ extern const NAME_CODE tls_level_table[]; #if (OPENSSL_VERSION_NUMBER < 0x00905100L) #error "need OpenSSL version 0.9.5 or later" +#endif + + /* Backwards compatibility with OpenSSL < 1.1.0 */ +#if OPENSSL_VERSION_NUMBER < 0x10100000L +#define OpenSSL_version_num SSLeay #endif /* diff --git a/postfix/src/tls/tls_client.c b/postfix/src/tls/tls_client.c index d78bac356..d11a9ca36 100644 --- a/postfix/src/tls/tls_client.c +++ b/postfix/src/tls/tls_client.c @@ -848,7 +848,7 @@ TLS_SESS_STATE *tls_client_start(const TLS_CLIENT_START_PROPS *props) * Finally, salt the session key with the OpenSSL library version, * (run-time, rather than compile-time, just in case that matters). */ - vstring_sprintf_append(myserverid, "&l=%ld", (long) SSLeay()); + vstring_sprintf_append(myserverid, "&l=%ld", (long) OpenSSL_version_num()); /* * Allocate a new TLScontext for the new connection and get an SSL diff --git a/postfix/src/tls/tls_misc.c b/postfix/src/tls/tls_misc.c index 15d057674..b1ed9b235 100644 --- a/postfix/src/tls/tls_misc.c +++ b/postfix/src/tls/tls_misc.c @@ -861,7 +861,7 @@ void tls_check_version(void) TLS_VINFO lib_info; tls_version_split(OPENSSL_VERSION_NUMBER, &hdr_info); - tls_version_split(SSLeay(), &lib_info); + tls_version_split(OpenSSL_version_num(), &lib_info); if (lib_info.major != hdr_info.major || lib_info.minor != hdr_info.minor @@ -880,7 +880,7 @@ long tls_bug_bits(void) #if OPENSSL_VERSION_NUMBER >= 0x00908000L && \ OPENSSL_VERSION_NUMBER < 0x10000000L - long lib_version = SSLeay(); + long lib_version = OpenSSL_version_num(); /* * In OpenSSL 0.9.8[ab], enabling zlib compression breaks the padding bug diff --git a/postfix/src/tls/tls_server.c b/postfix/src/tls/tls_server.c index 69b071eab..a1cbf9f1e 100644 --- a/postfix/src/tls/tls_server.c +++ b/postfix/src/tls/tls_server.c @@ -193,7 +193,7 @@ static SSL_SESSION *get_server_session_cb(SSL *ssl, unsigned char *session_id, buf = vstring_alloc(2 * (len + strlen(service))); \ hex_encode(buf, (char *) (id), (len)); \ vstring_sprintf_append(buf, "&s=%s", (service)); \ - vstring_sprintf_append(buf, "&l=%ld", (long) SSLeay()); \ + vstring_sprintf_append(buf, "&l=%ld", (long) OpenSSL_version_num()); \ } while (0)