#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
/*
* 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
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
#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
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)