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
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
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>
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");
32 EVP_CIPHER_CTX* handle = EVP_CIPHER_CTX_new();
34 if (check_result(EVP_CipherInit_ex(handle, EVP_rc4(), NULL, NULL, NULL, -1)))