aboutsummaryrefslogtreecommitdiff
path: root/src/server/shared/Cryptography
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/shared/Cryptography')
-rwxr-xr-xsrc/server/shared/Cryptography/ARC4.h2
-rwxr-xr-xsrc/server/shared/Cryptography/Authentication/AuthCrypt.cpp3
-rwxr-xr-xsrc/server/shared/Cryptography/Authentication/AuthCrypt.h1
-rwxr-xr-xsrc/server/shared/Cryptography/BigNumber.cpp23
-rwxr-xr-xsrc/server/shared/Cryptography/BigNumber.h2
-rwxr-xr-xsrc/server/shared/Cryptography/HMACSHA1.h3
-rwxr-xr-xsrc/server/shared/Cryptography/SHA1.h4
7 files changed, 19 insertions, 19 deletions
diff --git a/src/server/shared/Cryptography/ARC4.h b/src/server/shared/Cryptography/ARC4.h
index 777dbb8cb99..abf753be02f 100755
--- a/src/server/shared/Cryptography/ARC4.h
+++ b/src/server/shared/Cryptography/ARC4.h
@@ -19,7 +19,7 @@
#ifndef _AUTH_SARC4_H
#define _AUTH_SARC4_H
-#include "Common.h"
+#include "Define.h"
#include <openssl/evp.h>
class ARC4
diff --git a/src/server/shared/Cryptography/Authentication/AuthCrypt.cpp b/src/server/shared/Cryptography/Authentication/AuthCrypt.cpp
index 146f4e992b7..a2db02dfbe3 100755
--- a/src/server/shared/Cryptography/Authentication/AuthCrypt.cpp
+++ b/src/server/shared/Cryptography/Authentication/AuthCrypt.cpp
@@ -18,12 +18,11 @@
#include "AuthCrypt.h"
#include "Cryptography/HMACSHA1.h"
-#include "Logging/Log.h"
#include "Cryptography/BigNumber.h"
AuthCrypt::AuthCrypt() : _clientDecrypt(SHA_DIGEST_LENGTH), _serverEncrypt(SHA_DIGEST_LENGTH)
+ , _initialized(false)
{
- _initialized = false;
}
AuthCrypt::~AuthCrypt()
diff --git a/src/server/shared/Cryptography/Authentication/AuthCrypt.h b/src/server/shared/Cryptography/Authentication/AuthCrypt.h
index 0304ef6b69e..e7463b0d962 100755
--- a/src/server/shared/Cryptography/Authentication/AuthCrypt.h
+++ b/src/server/shared/Cryptography/Authentication/AuthCrypt.h
@@ -19,7 +19,6 @@
#ifndef _AUTHCRYPT_H
#define _AUTHCRYPT_H
-#include <Common.h>
#include "Cryptography/ARC4.h"
class BigNumber;
diff --git a/src/server/shared/Cryptography/BigNumber.cpp b/src/server/shared/Cryptography/BigNumber.cpp
index 6149a680594..76cb74d5e13 100755
--- a/src/server/shared/Cryptography/BigNumber.cpp
+++ b/src/server/shared/Cryptography/BigNumber.cpp
@@ -18,31 +18,30 @@
#include "Cryptography/BigNumber.h"
#include <openssl/bn.h>
+#include <openssl/crypto.h>
#include <algorithm>
BigNumber::BigNumber()
-{
- _bn = BN_new();
- _array = NULL;
-}
+ : _bn(BN_new())
+ , _array(NULL)
+{ }
BigNumber::BigNumber(const BigNumber &bn)
-{
- _bn = BN_dup(bn._bn);
- _array = NULL;
-}
+ : _bn(BN_dup(bn._bn))
+ , _array(NULL)
+{ }
BigNumber::BigNumber(uint32 val)
+ : _bn(BN_new())
+ , _array(NULL)
{
- _bn = BN_new();
BN_set_word(_bn, val);
- _array = NULL;
}
BigNumber::~BigNumber()
{
BN_free(_bn);
- if (_array) delete[] _array;
+ delete[] _array;
}
void BigNumber::SetDword(uint32 val)
@@ -76,6 +75,8 @@ void BigNumber::SetRand(int numbits)
BigNumber BigNumber::operator=(const BigNumber &bn)
{
+ if (this == &bn)
+ return *this;
BN_copy(_bn, bn._bn);
return *this;
}
diff --git a/src/server/shared/Cryptography/BigNumber.h b/src/server/shared/Cryptography/BigNumber.h
index 485d4ced470..eb450c27777 100755
--- a/src/server/shared/Cryptography/BigNumber.h
+++ b/src/server/shared/Cryptography/BigNumber.h
@@ -19,7 +19,7 @@
#ifndef _AUTH_BIGNUMBER_H
#define _AUTH_BIGNUMBER_H
-#include "Common.h"
+#include "Define.h"
struct bignum_st;
diff --git a/src/server/shared/Cryptography/HMACSHA1.h b/src/server/shared/Cryptography/HMACSHA1.h
index 180ac6f4262..2d6e0c276a8 100755
--- a/src/server/shared/Cryptography/HMACSHA1.h
+++ b/src/server/shared/Cryptography/HMACSHA1.h
@@ -19,7 +19,8 @@
#ifndef _AUTH_HMAC_H
#define _AUTH_HMAC_H
-#include "Common.h"
+#include "Define.h"
+#include <string>
#include <openssl/hmac.h>
#include <openssl/sha.h>
diff --git a/src/server/shared/Cryptography/SHA1.h b/src/server/shared/Cryptography/SHA1.h
index 27e2d3290d0..9cb9b7b90f9 100755
--- a/src/server/shared/Cryptography/SHA1.h
+++ b/src/server/shared/Cryptography/SHA1.h
@@ -19,9 +19,9 @@
#ifndef _AUTH_SHA1_H
#define _AUTH_SHA1_H
-#include "Common.h"
+#include "Define.h"
+#include <string>
#include <openssl/sha.h>
-#include <openssl/crypto.h>
class BigNumber;