summaryrefslogtreecommitdiffstats
path: root/src/Protocol/Protocol132.cpp
diff options
context:
space:
mode:
authorTycho Bickerstaff <work.tycho@gmail.com>2014-01-02 18:49:55 +0100
committerTycho Bickerstaff <work.tycho@gmail.com>2014-01-02 18:49:55 +0100
commitea6f94f6cb703f29511a844fc9e14567986e73ee (patch)
tree6b9df61798a94c8e9977deb44de148b76a55d331 /src/Protocol/Protocol132.cpp
parentadded documentation (diff)
parentMerge remote-tracking branch 'origin/master' (diff)
downloadcuberite-ea6f94f6cb703f29511a844fc9e14567986e73ee.tar
cuberite-ea6f94f6cb703f29511a844fc9e14567986e73ee.tar.gz
cuberite-ea6f94f6cb703f29511a844fc9e14567986e73ee.tar.bz2
cuberite-ea6f94f6cb703f29511a844fc9e14567986e73ee.tar.lz
cuberite-ea6f94f6cb703f29511a844fc9e14567986e73ee.tar.xz
cuberite-ea6f94f6cb703f29511a844fc9e14567986e73ee.tar.zst
cuberite-ea6f94f6cb703f29511a844fc9e14567986e73ee.zip
Diffstat (limited to '')
-rw-r--r--src/Protocol/Protocol132.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Protocol/Protocol132.cpp b/src/Protocol/Protocol132.cpp
index 346607b79..46ac4ef89 100644
--- a/src/Protocol/Protocol132.cpp
+++ b/src/Protocol/Protocol132.cpp
@@ -886,15 +886,15 @@ void cProtocol132::HandleEncryptionKeyResponse(const AString & a_EncKey, const A
time_t CurTime = time(NULL);
CryptoPP::RandomPool rng;
rng.Put((const byte *)&CurTime, sizeof(CurTime));
- byte DecryptedNonce[MAX_ENC_LEN];
- DecodingResult res = rsaDecryptor.Decrypt(rng, (const byte *)a_EncNonce.data(), a_EncNonce.size(), DecryptedNonce);
+ Int32 DecryptedNonce[MAX_ENC_LEN / sizeof(Int32)];
+ DecodingResult res = rsaDecryptor.Decrypt(rng, (const byte *)a_EncNonce.data(), a_EncNonce.size(), (byte *)DecryptedNonce);
if (!res.isValidCoding || (res.messageLength != 4))
{
LOGD("Bad nonce length");
m_Client->Kick("Hacked client");
return;
}
- if (ntohl(*((int *)DecryptedNonce)) != (unsigned)(uintptr_t)this)
+ if (ntohl(DecryptedNonce[0]) != (unsigned)(uintptr_t)this)
{
LOGD("Bad nonce value");
m_Client->Kick("Hacked client");