]> granicus.if.org Git - transmission/commitdiff
LibreSSL compatibility
authorNiklas Haas <git@haasn.xyz>
Sat, 20 May 2017 05:16:53 +0000 (07:16 +0200)
committerNiklas Haas <git@haasn.xyz>
Sat, 20 May 2017 05:16:53 +0000 (07:16 +0200)
This seems to be the idiomatic way to fix libressl compatibility issues,
judging by what most other open source projects seem to be doing.

I've confirmed that transmission builds with libressl for me after this
patch is applied.

libtransmission/crypto-utils-openssl.c

index 67e372582c58dc61f736dd90c7aba8d5f0fac224..a81a0d12ec07c7151f9d1c5d551a58be7a534b3d 100644 (file)
@@ -49,7 +49,7 @@ static void log_openssl_error(char const* file, int line)
 
         if (!strings_loaded)
         {
-#if OPENSSL_VERSION_NUMBER < 0x10100000
+#if OPENSSL_VERSION_NUMBER < 0x10100000 || defined(LIBRESSL_VERSION_NUMBER)
             ERR_load_crypto_strings();
 #else
             OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL);
@@ -238,7 +238,7 @@ void tr_rc4_process(tr_rc4_ctx_t handle, void const* input, void* output, size_t
 ****
 ***/
 
-#if OPENSSL_VERSION_NUMBER < 0x10100000
+#if OPENSSL_VERSION_NUMBER < 0x10100000 || defined(LIBRESSL_VERSION_NUMBER)
 
 static inline int DH_set0_pqg(DH* dh, BIGNUM* p, BIGNUM* q, BIGNUM* g)
 {