mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-11-07 17:36:07 +00:00
Remove padding mechanism
Not needed anymore since proper encryption is now used under Mono
This commit is contained in:
parent
67affc6270
commit
3224c59eab
8 changed files with 7 additions and 101 deletions
|
|
@ -197,14 +197,13 @@ namespace MinecraftClient.Crypto
|
|||
/// </summary>
|
||||
/// <param name="underlyingStream">Stream to encrypt</param>
|
||||
/// <param name="AesKey">Key to use</param>
|
||||
/// <param name="paddingProvider">Padding provider for Mono implementation</param>
|
||||
/// <returns>Return an appropriate stream depending on the framework being used</returns>
|
||||
|
||||
public static IAesStream getAesStream(Stream underlyingStream, byte[] AesKey, IPaddingProvider paddingProvider)
|
||||
public static IAesStream getAesStream(Stream underlyingStream, byte[] AesKey)
|
||||
{
|
||||
if (Program.isUsingMono)
|
||||
{
|
||||
return new Streams.MonoAesStream(underlyingStream, AesKey, paddingProvider);
|
||||
return new Streams.MonoAesStream(underlyingStream, AesKey);
|
||||
}
|
||||
else return new Streams.RegularAesStream(underlyingStream, AesKey);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,17 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace MinecraftClient.Crypto
|
||||
{
|
||||
/// <summary>
|
||||
/// Interface for padding provider
|
||||
/// Allow to get a padding plugin message from the current network protocol implementation.
|
||||
/// </summary>
|
||||
|
||||
public interface IPaddingProvider
|
||||
{
|
||||
byte[] getPaddingPacket();
|
||||
}
|
||||
}
|
||||
|
|
@ -19,15 +19,13 @@ namespace MinecraftClient.Crypto.Streams
|
|||
|
||||
public class MonoAesStream : Stream, IAesStream
|
||||
{
|
||||
IPaddingProvider pad;
|
||||
CipherStream cstream;
|
||||
public MonoAesStream(System.IO.Stream stream, byte[] key, IPaddingProvider provider)
|
||||
public MonoAesStream(System.IO.Stream stream, byte[] key)
|
||||
{
|
||||
BaseStream = stream;
|
||||
BufferedBlockCipher enc = GenerateAES(key, true);
|
||||
BufferedBlockCipher dec = GenerateAES(key, false);
|
||||
cstream = new CipherStream(stream, dec, enc);
|
||||
pad = provider;
|
||||
}
|
||||
public System.IO.Stream BaseStream { get; set; }
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue