-
-
Notifications
You must be signed in to change notification settings - Fork 28
/
transmission-legacy-ssl.patch
29 lines (27 loc) · 933 Bytes
/
transmission-legacy-ssl.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
diff --git a/libtransmission/crypto-utils-openssl.c b/libtransmission/crypto-utils-openssl.c
index 45fd719..5ed23d2 100644
--- a/libtransmission/crypto-utils-openssl.c
+++ b/libtransmission/crypto-utils-openssl.c
@@ -184,6 +184,24 @@ 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 *deflt;
+ OSSL_PROVIDER *legacy;
+
+ legacy = OSSL_PROVIDER_load(NULL, "legacy");
+ if (legacy == NULL) {
+ printf("Failed to load legacy provider\n");
+ return NULL;
+ }
+
+ deflt = OSSL_PROVIDER_load(NULL, "default");
+ if (deflt == NULL) {
+ OSSL_PROVIDER_unload(legacy);
+ printf("Failed to load default provider\n");
+ return NULL;
+ }
+#endif
+
EVP_CIPHER_CTX* handle = EVP_CIPHER_CTX_new();
if (check_result(EVP_CipherInit_ex(handle, EVP_rc4(), NULL, NULL, NULL, -1)))