diff --git a/src/shared/Auth/SARC4.cpp b/src/shared/Auth/SARC4.cpp index 33270e4fd73..5a4f1870372 100644 --- a/src/shared/Auth/SARC4.cpp +++ b/src/shared/Auth/SARC4.cpp @@ -18,9 +18,15 @@ #include "Auth/SARC4.h" #include +#if defined(OPENSSL_VERSION_MAJOR) && (OPENSSL_VERSION_MAJOR >= 3) +#include +#endif SARC4::SARC4(uint8 len) { +#if defined(OPENSSL_VERSION_MAJOR) && (OPENSSL_VERSION_MAJOR >= 3) + OSSL_PROVIDER_load(NULL, "legacy"); +#endif #if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10100000L m_ctx = EVP_CIPHER_CTX_new(); EVP_CIPHER_CTX_init(m_ctx); @@ -35,6 +41,9 @@ SARC4::SARC4(uint8 len) SARC4::SARC4(uint8* seed, uint8 len) { +#if defined(OPENSSL_VERSION_MAJOR) && (OPENSSL_VERSION_MAJOR >= 3) + OSSL_PROVIDER_load(NULL, "legacy"); +#endif #if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10100000L m_ctx = EVP_CIPHER_CTX_new(); EVP_CIPHER_CTX_init(m_ctx); @@ -61,6 +70,9 @@ SARC4::~SARC4() void SARC4::Init(uint8 const* seed) { +#if defined(OPENSSL_VERSION_MAJOR) && (OPENSSL_VERSION_MAJOR >= 3) + OSSL_PROVIDER_load(NULL, "legacy"); +#endif #if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10100000L EVP_EncryptInit_ex(m_ctx, nullptr, nullptr, seed, nullptr); #else