From: Mike Gelfand Date: Tue, 13 Oct 2015 21:24:31 +0000 (+0000) Subject: #6005: Bump minimum OpenSSL version to 0.9.7, fix build for versions less than 0... X-Git-Tag: 2.90~117 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=69687544d76a1bb14b07ea4a819191526a0d16c0;p=transmission #6005: Bump minimum OpenSSL version to 0.9.7, fix build for versions less than 0.9.8b --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 89564bd22..04ba884ab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -112,7 +112,7 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON) set(CURL_MINIMUM 7.15.4) set(EVENT2_MINIMUM 2.0.10) -set(OPENSSL_MINIMUM 0.9.4) +set(OPENSSL_MINIMUM 0.9.7) set(CYASSL_MINIMUM 3.0) set(POLARSSL_MINIMUM 1.2) set(ZLIB_MINIMUM 1.2.3) diff --git a/configure.ac b/configure.ac index 9866000b7..45580dbcd 100644 --- a/configure.ac +++ b/configure.ac @@ -47,7 +47,7 @@ ZLIB_MINIMUM=1.2.3 AC_SUBST(ZLIB_MINIMUM) # crypto backends -OPENSSL_MINIMUM=0.9.4 +OPENSSL_MINIMUM=0.9.7 AC_SUBST(OPENSSL_MINIMUM) CYASSL_MINIMUM=3.0 AC_SUBST(CYASSL_MINIMUM) diff --git a/libtransmission/crypto-utils-openssl.c b/libtransmission/crypto-utils-openssl.c index 2245f153f..61ec9490a 100644 --- a/libtransmission/crypto-utils-openssl.c +++ b/libtransmission/crypto-utils-openssl.c @@ -14,6 +14,7 @@ #include #include #include +#include #include "transmission.h" #include "crypto-utils.h" @@ -141,6 +142,32 @@ tr_sha1_final (tr_sha1_ctx_t handle, **** ***/ +#if OPENSSL_VERSION_NUMBER < 0x0090802fL + +static EVP_CIPHER_CTX * +openssl_evp_cipher_context_new (void) +{ + EVP_CIPHER_CTX * ctx = tr_new (EVP_CIPHER_CTX, 1); + if (ctx != NULL) + EVP_CIPHER_CTX_init (ctx); + return ctx; +} + +static void +openssl_evp_cipher_context_free (EVP_CIPHER_CTX * ctx) +{ + if (ctx) + { + EVP_CIPHER_CTX_cleanup (ctx); + tr_free (ctx); + } +} + +#define EVP_CIPHER_CTX_new() openssl_evp_cipher_context_new () +#define EVP_CIPHER_CTX_free(x) openssl_evp_cipher_context_free ((x)) + +#endif + tr_rc4_ctx_t tr_rc4_new (void) {