mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 01:08:35 +00:00
feat(Core/Crypto): add support OpenSSL 3.0 (#13354)
This commit is contained in:
@@ -18,17 +18,26 @@
|
||||
#include "ARC4.h"
|
||||
#include "Errors.h"
|
||||
|
||||
Acore::Crypto::ARC4::ARC4()
|
||||
: _ctx(EVP_CIPHER_CTX_new())
|
||||
Acore::Crypto::ARC4::ARC4() : _ctx(EVP_CIPHER_CTX_new())
|
||||
{
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
|
||||
_cipher = EVP_CIPHER_fetch(nullptr, "RC4", nullptr);
|
||||
#else
|
||||
EVP_CIPHER const* _cipher = EVP_rc4();
|
||||
#endif
|
||||
|
||||
EVP_CIPHER_CTX_init(_ctx);
|
||||
int result = EVP_EncryptInit_ex(_ctx, EVP_rc4(), nullptr, nullptr, nullptr);
|
||||
int result = EVP_EncryptInit_ex(_ctx, _cipher, nullptr, nullptr, nullptr);
|
||||
ASSERT(result == 1);
|
||||
}
|
||||
|
||||
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, size_t len)
|
||||
|
||||
Reference in New Issue
Block a user