From: Viktor Dukhovni Date: Sat, 31 Oct 2015 18:02:23 +0000 (-0400) 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=2e89ccbb087c08bd43dfc2c28a9274b9b54e4860;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 0b0097330..af3d1777f 100644 --- a/postfix/src/tls/tls.h +++ b/postfix/src/tls/tls.h @@ -81,6 +81,12 @@ extern const NAME_CODE tls_level_table[]; #if (OPENSSL_VERSION_NUMBER < 0x00090700f) #error "need OpenSSL version 0.9.7 or later" +#endif + + /* Backwards compatibility with OpenSSL < 1.1.0 */ +#if OPENSSL_VERSION_NUMBER < 0x10100000L +#define X509_up_ref(x) CRYPTO_add(&((x)->references), 1, CRYPTO_LOCK_X509) +#define OpenSSL_version_num SSLeay #endif /* SSL_CIPHER_get_name() got constified in 0.9.7g */ diff --git a/postfix/src/tls/tls_fprint.c b/postfix/src/tls/tls_fprint.c index abd5ff7d4..8d5d3a228 100644 --- a/postfix/src/tls/tls_fprint.c +++ b/postfix/src/tls/tls_fprint.c @@ -188,7 +188,7 @@ char *tls_serverid_digest(const TLS_CLIENT_START_PROPS *props, long protomask, msg_panic("digest algorithm \"%s\" not found", mdalg); /* Salt the session lookup key with the OpenSSL runtime version. */ - sslversion = SSLeay(); + sslversion = OpenSSL_version_num(); mdctx = EVP_MD_CTX_create(); checkok(EVP_DigestInit_ex(mdctx, md, NULL)); diff --git a/postfix/src/tls/tls_misc.c b/postfix/src/tls/tls_misc.c index 6450316ec..d20507c73 100644 --- a/postfix/src/tls/tls_misc.c +++ b/postfix/src/tls/tls_misc.c @@ -931,7 +931,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 @@ -950,7 +950,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 17f6df239..abb8ff752 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)