Fix patches to make them applicable

Resolves: #1988443
This commit is contained in:
Ondrej Holy 2021-08-04 10:07:27 +02:00
parent a651713077
commit a71c37f744
2 changed files with 4 additions and 5 deletions

View File

@ -32,7 +32,7 @@ index c47595b14..bd52cfeed 100644
@@ -75,7 +80,11 @@ static WINPR_RC4_CTX* winpr_RC4_New_Internal(const BYTE* key, size_t keylen, BOO
#endif
EVP_CIPHER_CTX_set_key_length((EVP_CIPHER_CTX*)ctx, (int)keylen);
EVP_CIPHER_CTX_set_key_length((EVP_CIPHER_CTX*)ctx, keylen);
- EVP_EncryptInit_ex((EVP_CIPHER_CTX*)ctx, NULL, NULL, key, NULL);
+ if (EVP_EncryptInit_ex((EVP_CIPHER_CTX*)ctx, NULL, NULL, key, NULL) != 1)
+ {

View File

@ -29,11 +29,10 @@ index bd52cfeed..75d25a1c7 100644
#endif
#ifdef WITH_MBEDTLS
@@ -57,6 +60,12 @@ static WINPR_RC4_CTX* winpr_RC4_New_Internal(const BYTE* key, size_t keylen, BOO
@@ -58,6 +60,11 @@ static WINPR_RC4_CTX* winpr_RC4_New_Internal(const BYTE* key, size_t keylen, BOO
#if defined(WITH_OPENSSL)
if (keylen > INT_MAX)
return NULL;
+
+#if defined(OPENSSL_VERSION_MAJOR) && (OPENSSL_VERSION_MAJOR >= 3)
+ if (OSSL_PROVIDER_load(NULL, "legacy") == NULL)
+ return NULL;