From fdc5849a69ad26aa7f7c53d12c7cdb436bc75e42 Mon Sep 17 00:00:00 2001 From: Dawnforger Date: Fri, 8 May 2026 20:28:46 -0500 Subject: [PATCH] fix(common): ARC4 OpenSSL 1.1 vs 3 API (EVP_CIPHER_fetch) --- src/common/Cryptography/ARC4.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/common/Cryptography/ARC4.cpp b/src/common/Cryptography/ARC4.cpp index d830d0d..9d2b26a 100644 --- a/src/common/Cryptography/ARC4.cpp +++ b/src/common/Cryptography/ARC4.cpp @@ -17,10 +17,16 @@ #include "ARC4.h" #include "Errors.h" +#include Acore::Crypto::ARC4::ARC4() : _ctx(EVP_CIPHER_CTX_new()) { +#if OPENSSL_VERSION_NUMBER >= 0x30000000L _cipher = EVP_CIPHER_fetch(nullptr, "RC4", nullptr); +#else + _cipher = const_cast(EVP_rc4()); +#endif + ASSERT(_cipher); EVP_CIPHER_CTX_init(_ctx); int result = EVP_EncryptInit_ex(_ctx, _cipher, nullptr, nullptr, nullptr); @@ -30,7 +36,9 @@ Acore::Crypto::ARC4::ARC4() : _ctx(EVP_CIPHER_CTX_new()) Acore::Crypto::ARC4::~ARC4() { EVP_CIPHER_CTX_free(_ctx); +#if OPENSSL_VERSION_NUMBER >= 0x30000000L EVP_CIPHER_free(_cipher); +#endif } void Acore::Crypto::ARC4::Init(uint8 const* seed, std::size_t len)