]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
Bitrot: 'SSLeay' function names purged from OpenSSL 1.1.0
authorViktor Dukhovni <postfix-users@dukhovni.org>
Sun, 10 Jan 2016 07:45:53 +0000 (02:45 -0500)
committerViktor Dukhovni <postfix-users@dukhovni.org>
Thu, 26 May 2016 04:43:53 +0000 (00:43 -0400)
postfix/src/tls/tls.h
postfix/src/tls/tls_client.c
postfix/src/tls/tls_misc.c
postfix/src/tls/tls_server.c

index b62174635e078ec4d5ae13c44345c5ae3edd68a1..78348eabd50b21b7a7adf80b059770244cac744a 100644 (file)
@@ -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
 
  /*
index d78bac356f7c3b16a40e7884e6f58d1ef1e09b32..d11a9ca36c911d13cf015f85dce1cd17b2e638c9 100644 (file)
@@ -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
index 15d057674ed1822e17ddf9b9e80a4fd083665838..b1ed9b235b9dca8c03902bd33f484bc24ea74a42 100644 (file)
@@ -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
index 69b071eab4f6daa2f66af52697636cecaaf3f54d..a1cbf9f1ec731faa6e44106dd5c01bb6b3eb04b2 100644 (file)
@@ -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)