mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-02 23:26:37 +01:00
Common/Crypto: Reduce differences between 3.3.5 and 6.x branches
Code functionality shouldn't have been modified.
This commit is contained in:
@@ -18,14 +18,14 @@
|
||||
|
||||
#include "ARC4.h"
|
||||
|
||||
ARC4::ARC4(uint8 len) : m_ctx()
|
||||
ARC4::ARC4(uint32 len) : m_ctx()
|
||||
{
|
||||
EVP_CIPHER_CTX_init(&m_ctx);
|
||||
EVP_EncryptInit_ex(&m_ctx, EVP_rc4(), NULL, NULL, NULL);
|
||||
EVP_CIPHER_CTX_set_key_length(&m_ctx, len);
|
||||
}
|
||||
|
||||
ARC4::ARC4(uint8 *seed, uint8 len) : m_ctx()
|
||||
ARC4::ARC4(uint8 *seed, uint32 len) : m_ctx()
|
||||
{
|
||||
EVP_CIPHER_CTX_init(&m_ctx);
|
||||
EVP_EncryptInit_ex(&m_ctx, EVP_rc4(), NULL, NULL, NULL);
|
||||
|
||||
@@ -25,8 +25,8 @@
|
||||
class ARC4
|
||||
{
|
||||
public:
|
||||
ARC4(uint8 len);
|
||||
ARC4(uint8 *seed, uint8 len);
|
||||
ARC4(uint32 len);
|
||||
ARC4(uint8 *seed, uint32 len);
|
||||
~ARC4();
|
||||
void Init(uint8 *seed);
|
||||
void UpdateData(int len, uint8 *data);
|
||||
|
||||
@@ -163,11 +163,16 @@ uint32 BigNumber::AsDword()
|
||||
return (uint32)BN_get_word(_bn);
|
||||
}
|
||||
|
||||
bool BigNumber::isZero() const
|
||||
bool BigNumber::IsZero() const
|
||||
{
|
||||
return BN_is_zero(_bn);
|
||||
}
|
||||
|
||||
bool BigNumber::IsNegative() const
|
||||
{
|
||||
return BN_is_negative(_bn);
|
||||
}
|
||||
|
||||
std::unique_ptr<uint8[]> BigNumber::AsByteArray(int32 minSize, bool littleEndian)
|
||||
{
|
||||
int numBytes = GetNumBytes();
|
||||
|
||||
@@ -77,7 +77,8 @@ class BigNumber
|
||||
return t %= bn;
|
||||
}
|
||||
|
||||
bool isZero() const;
|
||||
bool IsZero() const;
|
||||
bool IsNegative() const;
|
||||
|
||||
BigNumber ModExp(BigNumber const& bn1, BigNumber const& bn2);
|
||||
BigNumber Exp(BigNumber const&);
|
||||
|
||||
@@ -501,7 +501,7 @@ bool AuthSession::HandleLogonProof()
|
||||
A.SetBinary(logonProof->A, 32);
|
||||
|
||||
// SRP safeguard: abort if A == 0
|
||||
if (A.isZero())
|
||||
if (A.IsZero())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user