aboutsummaryrefslogtreecommitdiff
path: root/src/shared/Auth
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/Auth')
-rw-r--r--src/shared/Auth/AuthCrypt.cpp5
-rw-r--r--src/shared/Auth/AuthCrypt.h1
-rw-r--r--src/shared/Auth/Makefile.am26
3 files changed, 15 insertions, 17 deletions
diff --git a/src/shared/Auth/AuthCrypt.cpp b/src/shared/Auth/AuthCrypt.cpp
index 7941b33ed8c..68a271e3c42 100644
--- a/src/shared/Auth/AuthCrypt.cpp
+++ b/src/shared/Auth/AuthCrypt.cpp
@@ -50,9 +50,8 @@ void AuthCrypt::DecryptRecv(uint8 *data, size_t len)
void AuthCrypt::EncryptSend(uint8 *data, size_t len)
{
if (!_initialized) return;
- if (len < CRYPTED_SEND_LEN) return;
- for (size_t t = 0; t < CRYPTED_SEND_LEN; t++)
+ for (size_t t = 0; t < len; t++)
{
_send_i %= _key.size();
uint8 x = (data[t] ^ _key[_send_i]) + _send_j;
@@ -67,7 +66,7 @@ void AuthCrypt::SetKey(BigNumber *bn)
GenerateKey(key, bn);
_key.resize(SHA_DIGEST_LENGTH);
std::copy(key, key + SHA_DIGEST_LENGTH, _key.begin());
- delete key;
+ delete[] key;
}
AuthCrypt::~AuthCrypt()
diff --git a/src/shared/Auth/AuthCrypt.h b/src/shared/Auth/AuthCrypt.h
index f3a0cac40fa..366cce5635f 100644
--- a/src/shared/Auth/AuthCrypt.h
+++ b/src/shared/Auth/AuthCrypt.h
@@ -32,7 +32,6 @@ class AuthCrypt
AuthCrypt();
~AuthCrypt();
- const static size_t CRYPTED_SEND_LEN = 4;
const static size_t CRYPTED_RECV_LEN = 6;
void Init();
diff --git a/src/shared/Auth/Makefile.am b/src/shared/Auth/Makefile.am
index 9c71613a0de..f0d4044aafb 100644
--- a/src/shared/Auth/Makefile.am
+++ b/src/shared/Auth/Makefile.am
@@ -9,19 +9,19 @@
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
## Process this file with automake to produce Makefile.in
## Sub-directories to parse
## CPP flags for includes, defines, etc.
-AM_CPPFLAGS = $(MYSQL_INCLUDES) $(POSTGRE_INCLUDES) -I$(top_builddir)/src/shared -I$(srcdir) -I$(srcdir)/../../../dep/include -I$(srcdir)/../../framework -I$(srcdir)/../../shared -I$(srcdir)/../../../dep/include/g3dlite
+AM_CPPFLAGS = $(TRINI_INCLUDES) -I$(top_builddir)/src/shared -I$(srcdir) -I$(srcdir)/../../../dep/include -I$(srcdir)/../../framework -I$(srcdir)/../../shared -I$(srcdir)/../../../dep/include/g3dlite
## Build MaNGOS shared library and its parts as convenience library.
# All libraries will be convenience libraries. Might be changed to shared
@@ -29,13 +29,13 @@ AM_CPPFLAGS = $(MYSQL_INCLUDES) $(POSTGRE_INCLUDES) -I$(top_builddir)/src/shared
noinst_LIBRARIES = libmangosauth.a
libmangosauth_a_SOURCES = \
- AuthCrypt.cpp \
- AuthCrypt.h \
- BigNumber.cpp \
- BigNumber.h \
- Hmac.cpp \
- Hmac.h \
- Sha1.cpp \
- Sha1.h \
- md5.c \
- md5.h
+ AuthCrypt.cpp \
+ AuthCrypt.h \
+ BigNumber.cpp \
+ BigNumber.h \
+ Hmac.cpp \
+ Hmac.h \
+ Sha1.cpp \
+ Sha1.h \
+ md5.c \
+ md5.h