fluffychat: 1.22.1 -> 1.23.0 (#364091)
[NixPkgs.git] / pkgs / by-name / tr / transmission_3 / transmission-3.00-openssl-3.patch
blobf288298cbf3d4604b6f875157e0e5ba83762593c
1 From 6ee128b95bacaff20746538dc97c2b8e2b9fcc29 Mon Sep 17 00:00:00 2001
2 From: Mike Gilbert <floppym@gentoo.org>
3 Date: Sun, 15 May 2022 10:54:38 -0400
4 Subject: [PATCH] openssl: load "legacy" provider for RC4
6 ---
7 libtransmission/crypto-utils-openssl.c | 7 +++++++
8 1 file changed, 7 insertions(+)
10 diff --git a/libtransmission/crypto-utils-openssl.c b/libtransmission/crypto-utils-openssl.c
11 index 45fd71913..14d680654 100644
12 --- a/libtransmission/crypto-utils-openssl.c
13 +++ b/libtransmission/crypto-utils-openssl.c
14 @@ -20,6 +20,9 @@
15 #include <openssl/rand.h>
16 #include <openssl/ssl.h>
17 #include <openssl/x509.h>
18 +#if OPENSSL_VERSION_MAJOR >= 3
19 +#include <openssl/provider.h>
20 +#endif
22 #include "transmission.h"
23 #include "crypto-utils.h"
24 @@ -184,6 +187,10 @@ static void openssl_evp_cipher_context_free(EVP_CIPHER_CTX* handle)
26 tr_rc4_ctx_t tr_rc4_new(void)
28 +#if OPENSSL_VERSION_MAJOR >= 3
29 + OSSL_PROVIDER_load(NULL, "default");
30 + OSSL_PROVIDER_load(NULL, "legacy");
31 +#endif
32 EVP_CIPHER_CTX* handle = EVP_CIPHER_CTX_new();
34 if (check_result(EVP_CipherInit_ex(handle, EVP_rc4(), NULL, NULL, NULL, -1)))
35 --
36 2.35.1