]> granicus.if.org Git - transmission/commitdiff
#6005: Bump minimum OpenSSL version to 0.9.7, fix build for versions less than 0...
authorMike Gelfand <mikedld@mikedld.com>
Tue, 13 Oct 2015 21:24:31 +0000 (21:24 +0000)
committerMike Gelfand <mikedld@mikedld.com>
Tue, 13 Oct 2015 21:24:31 +0000 (21:24 +0000)
CMakeLists.txt
configure.ac
libtransmission/crypto-utils-openssl.c

index 89564bd22400206e251552472ef0d7d551dd24a5..04ba884abccf0ca9b6779edc5fc77ca4c67182f4 100644 (file)
@@ -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)
index 9866000b743723eea2782f65831bb9d4229c2c23..45580dbcd2abcfdfb3d9513119578c3d32b5d950 100644 (file)
@@ -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)
index 2245f153f3764bbed4b150b29d07fe2fd9167a84..61ec9490ad89ff516d28eb942dde81ae81cac992 100644 (file)
@@ -14,6 +14,7 @@
 #include <openssl/err.h>
 #include <openssl/evp.h>
 #include <openssl/rand.h>
+#include <openssl/opensslv.h>
 
 #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)
 {