mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/LCE-Revelations.git
synced 2026-06-22 16:05:32 +00:00
feat: upgrade stream cipher from XOR to AES-128-CTR
Replace the XOR obfuscation cipher with AES-128-CTR using the Windows BCrypt API. Key material grows from 16 to 32 bytes (16 AES key + 16 IV). All callers auto-adjust via StreamCipher::KEY_SIZE. No handshake or protocol changes needed beyond the larger MC|CKey payload.
This commit is contained in:
@@ -310,7 +310,7 @@ bool WinsockNetLayer::SendAckAndActivateClientSendCipher()
|
||||
{
|
||||
// Activate send cipher immediately after the ack is on the wire
|
||||
EnterCriticalSection(&s_clientCipherLock);
|
||||
s_clientSendCipher.Initialize(s_clientPendingKey);
|
||||
s_clientSendCipher.Initialize(s_clientPendingKey, ServerRuntime::Security::StreamCipher::Client);
|
||||
LeaveCriticalSection(&s_clientCipherLock);
|
||||
app.DebugPrintf("Client: Send cipher activated (MC|CAck sent)\n");
|
||||
}
|
||||
@@ -329,7 +329,7 @@ bool WinsockNetLayer::SendAckAndActivateClientSendCipher()
|
||||
void WinsockNetLayer::ActivateClientRecvCipher()
|
||||
{
|
||||
EnterCriticalSection(&s_clientCipherLock);
|
||||
s_clientRecvCipher.Initialize(s_clientPendingKey);
|
||||
s_clientRecvCipher.Initialize(s_clientPendingKey, ServerRuntime::Security::StreamCipher::Client);
|
||||
SecureZeroMemory(s_clientPendingKey, sizeof(s_clientPendingKey));
|
||||
s_clientKeyStored = false;
|
||||
LeaveCriticalSection(&s_clientCipherLock);
|
||||
|
||||
Reference in New Issue
Block a user