146 lines
4.7 KiB
C#
146 lines
4.7 KiB
C#
using System;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls
|
|
{
|
|
// Token: 0x02001C7C RID: 7292
|
|
[Token(Token = "0x2001C7C")]
|
|
public class TlsStreamCipher : TlsCipher
|
|
{
|
|
// Token: 0x0600B3F6 RID: 46070 RVA: 0x0026DA60 File Offset: 0x0026BC60
|
|
[Token(Token = "0x600B3F6")]
|
|
[Address(RVA = "0x466C80", Offset = "0x465C80", VA = "0x180466C80")]
|
|
public TlsStreamCipher(TlsContext context, IStreamCipher clientWriteCipher, IStreamCipher serverWriteCipher, IDigest clientWriteDigest, IDigest serverWriteDigest, int cipherKeySize, bool usesNonce)
|
|
{
|
|
this.usesNonce = false;
|
|
this.context = context;
|
|
this.encryptCipher = clientWriteCipher;
|
|
this.decryptCipher = serverWriteCipher;
|
|
bool flag;
|
|
if (!flag)
|
|
{
|
|
}
|
|
int num = 0;
|
|
TlsMac tlsMac;
|
|
num += tlsMac;
|
|
this.writeMac = tlsMac;
|
|
TlsMac tlsMac2;
|
|
this.readMac = tlsMac2;
|
|
this.encryptCipher = serverWriteCipher;
|
|
this.decryptCipher = clientWriteCipher;
|
|
byte[] array = new byte[8];
|
|
KeyParameter keyParameter;
|
|
ParametersWithIV parametersWithIV = new ParametersWithIV(keyParameter, array);
|
|
KeyParameter keyParameter2;
|
|
ParametersWithIV parametersWithIV2 = new ParametersWithIV(keyParameter2, array);
|
|
IStreamCipher streamCipher = this.encryptCipher;
|
|
IStreamCipher streamCipher2 = this.decryptCipher;
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0600B3F7 RID: 46071 RVA: 0x0026DAF8 File Offset: 0x0026BCF8
|
|
[Token(Token = "0x600B3F7")]
|
|
[Address(RVA = "0x466A50", Offset = "0x465A50", VA = "0x180466A50", Slot = "7")]
|
|
public virtual int GetPlaintextLimit(int ciphertextLimit)
|
|
{
|
|
byte[] macSecret = this.writeMac.MacSecret;
|
|
return ciphertextLimit;
|
|
}
|
|
|
|
// Token: 0x0600B3F8 RID: 46072 RVA: 0x0026DB18 File Offset: 0x0026BD18
|
|
[Token(Token = "0x600B3F8")]
|
|
[Address(RVA = "0x4668D0", Offset = "0x4658D0", VA = "0x1804668D0", Slot = "8")]
|
|
public virtual byte[] EncodePlaintext(long seqNo, byte type, byte[] plaintext, int offset, int len)
|
|
{
|
|
if (this.usesNonce)
|
|
{
|
|
}
|
|
byte[] macSecret = this.writeMac.MacSecret;
|
|
byte[] array = new byte[0];
|
|
IStreamCipher streamCipher = this.encryptCipher;
|
|
int size = this.writeMac.Size;
|
|
IStreamCipher streamCipher2 = this.encryptCipher;
|
|
return array;
|
|
}
|
|
|
|
// Token: 0x0600B3F9 RID: 46073 RVA: 0x0026DB64 File Offset: 0x0026BD64
|
|
[Token(Token = "0x600B3F9")]
|
|
[Address(RVA = "0x466720", Offset = "0x465720", VA = "0x180466720", Slot = "9")]
|
|
public virtual byte[] DecodeCiphertext(long seqNo, byte type, byte[] ciphertext, int offset, int len)
|
|
{
|
|
if (this.usesNonce)
|
|
{
|
|
}
|
|
byte[] macSecret = this.readMac.MacSecret;
|
|
byte[] array = new byte[0];
|
|
IStreamCipher streamCipher = this.decryptCipher;
|
|
byte[] array2;
|
|
return array2;
|
|
}
|
|
|
|
// Token: 0x0600B3FA RID: 46074 RVA: 0x0026DB9C File Offset: 0x0026BD9C
|
|
[Token(Token = "0x600B3FA")]
|
|
[Address(RVA = "0x466600", Offset = "0x465600", VA = "0x180466600", Slot = "10")]
|
|
protected virtual void CheckMac(long seqNo, byte type, byte[] recBuf, int recStart, int recEnd, byte[] calcBuf, int calcOff, int calcLen)
|
|
{
|
|
bool flag;
|
|
do
|
|
{
|
|
int size = this.readMac.Size;
|
|
}
|
|
while (!flag);
|
|
}
|
|
|
|
// Token: 0x0600B3FB RID: 46075 RVA: 0x0026DBBC File Offset: 0x0026BDBC
|
|
[Token(Token = "0x600B3FB")]
|
|
[Address(RVA = "0x466A90", Offset = "0x465A90", VA = "0x180466A90", Slot = "11")]
|
|
protected virtual void UpdateIV(IStreamCipher cipher, bool forEncryption, long seqNo)
|
|
{
|
|
byte[] array = new byte[8];
|
|
array[0] = (byte)seqNo;
|
|
array[0] = (byte)seqNo;
|
|
array[0] = (byte)seqNo;
|
|
array[0] = (byte)seqNo;
|
|
array[0] = (byte)seqNo;
|
|
array[0] = (byte)seqNo;
|
|
array[0] = (byte)seqNo;
|
|
array[0] = (byte)seqNo;
|
|
int num;
|
|
ParametersWithIV parametersWithIV = new ParametersWithIV(num, array);
|
|
num = 0;
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0400723F RID: 29247
|
|
[FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x400723F")]
|
|
protected readonly TlsContext context;
|
|
|
|
// Token: 0x04007240 RID: 29248
|
|
[FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x4007240")]
|
|
protected readonly IStreamCipher encryptCipher;
|
|
|
|
// Token: 0x04007241 RID: 29249
|
|
[FieldOffset(Offset = "0x20")]
|
|
[Token(Token = "0x4007241")]
|
|
protected readonly IStreamCipher decryptCipher;
|
|
|
|
// Token: 0x04007242 RID: 29250
|
|
[FieldOffset(Offset = "0x28")]
|
|
[Token(Token = "0x4007242")]
|
|
protected readonly TlsMac writeMac;
|
|
|
|
// Token: 0x04007243 RID: 29251
|
|
[FieldOffset(Offset = "0x30")]
|
|
[Token(Token = "0x4007243")]
|
|
protected readonly TlsMac readMac;
|
|
|
|
// Token: 0x04007244 RID: 29252
|
|
[FieldOffset(Offset = "0x38")]
|
|
[Token(Token = "0x4007244")]
|
|
protected readonly bool usesNonce;
|
|
}
|
|
}
|