git » transmission.git » commit ba29ccc

fix compatibility with OpenSSL 3.0

author Evangelos Foutras
2022-11-03 23:02:59 UTC
committer Evangelos Foutras
2022-11-03 23:02:59 UTC
parent b64f42c9ae829eda9f2c04103b445ff1f538fb41

fix compatibility with OpenSSL 3.0

Apply patch from Gentoo that enables the legacy provider (FS#76411).

PKGBUILD +8 -2
transmission-3.00-openssl-3.patch +37 -0

diff --git a/PKGBUILD b/PKGBUILD
index c1f7f4c..22b5397 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,22 +4,28 @@
 pkgbase=transmission
 pkgname=(transmission-cli transmission-gtk transmission-qt libtransmission)
 pkgver=3.00
-pkgrel=5
+pkgrel=6
 arch=(x86_64)
 url="http://www.transmissionbt.com/"
 license=(MIT)
 makedepends=(gtk3 intltool curl qt5-base libevent systemd qt5-tools libappindicator-gtk3 dht libb64 libutp miniupnpc libnatpmp)
 source=(https://github.com/transmission/transmission-releases/raw/master/transmission-${pkgver}.tar.xz
+        transmission-3.00-openssl-3.patch
         transmission-cli.sysusers
         transmission-cli.tmpfiles)
 sha256sums=('9144652fe742f7f7dd6657716e378da60b751aaeda8bef8344b3eefc4db255f2'
+            'a5e56b906724f007db0bdb9835fbf5088bb56a521ec2971aec0ea44578d5955b'
             '641310fb0590d40e00bea1b5b9c843953ab78edf019109f276be9c6a7bdaf5b2'
             '1266032bb07e47d6bcdc7dabd74df2557cc466c33bf983a5881316a4cc098451')
 
 prepare() {
   cd $pkgbase-$pkgver
 
-# Fix build with autoconf 2.70
+  # Fix compatibility with OpenSSL 3.0 (patch from Gentoo)
+  # https://github.com/transmission/transmission/issues/1777
+  patch -Np1 -i ../transmission-3.00-openssl-3.patch
+
+  # Fix build with autoconf 2.70
   sed -i 's/\[IT_PROG_INTLTOOL(\[/[\nIT_PROG_INTLTOOL(\[/' configure.ac
   rm -f m4/glib-gettext.m4
   autoreconf -fi
diff --git a/transmission-3.00-openssl-3.patch b/transmission-3.00-openssl-3.patch
new file mode 100644
index 0000000..f288298
--- /dev/null
+++ b/transmission-3.00-openssl-3.patch
@@ -0,0 +1,37 @@
+From 6ee128b95bacaff20746538dc97c2b8e2b9fcc29 Mon Sep 17 00:00:00 2001
+From: Mike Gilbert <floppym@gentoo.org>
+Date: Sun, 15 May 2022 10:54:38 -0400
+Subject: [PATCH] openssl: load "legacy" provider for RC4
+
+---
+ libtransmission/crypto-utils-openssl.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/libtransmission/crypto-utils-openssl.c b/libtransmission/crypto-utils-openssl.c
+index 45fd71913..14d680654 100644
+--- a/libtransmission/crypto-utils-openssl.c
++++ b/libtransmission/crypto-utils-openssl.c
+@@ -20,6 +20,9 @@
+ #include <openssl/rand.h>
+ #include <openssl/ssl.h>
+ #include <openssl/x509.h>
++#if OPENSSL_VERSION_MAJOR >= 3
++#include <openssl/provider.h>
++#endif
+ 
+ #include "transmission.h"
+ #include "crypto-utils.h"
+@@ -184,6 +187,10 @@ static void openssl_evp_cipher_context_free(EVP_CIPHER_CTX* handle)
+ 
+ tr_rc4_ctx_t tr_rc4_new(void)
+ {
++#if OPENSSL_VERSION_MAJOR >= 3
++    OSSL_PROVIDER_load(NULL, "default");
++    OSSL_PROVIDER_load(NULL, "legacy");
++#endif
+     EVP_CIPHER_CTX* handle = EVP_CIPHER_CTX_new();
+ 
+     if (check_result(EVP_CipherInit_ex(handle, EVP_rc4(), NULL, NULL, NULL, -1)))
+-- 
+2.35.1
+