m
This commit is contained in:
@@ -0,0 +1,239 @@
|
||||
using System;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
|
||||
using Cpp2IlInjected;
|
||||
using Hjg.Pngcs;
|
||||
|
||||
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls
|
||||
{
|
||||
// Token: 0x02001C3F RID: 7231
|
||||
[Token(Token = "0x2001C3F")]
|
||||
public class TlsAeadCipher : TlsCipher
|
||||
{
|
||||
// Token: 0x0600B1E5 RID: 45541 RVA: 0x00266EA4 File Offset: 0x002650A4
|
||||
[Token(Token = "0x600B1E5")]
|
||||
[Address(RVA = "0x49AE30", Offset = "0x499E30", VA = "0x18049AE30")]
|
||||
public TlsAeadCipher(TlsContext context, IAeadBlockCipher clientWriteCipher, IAeadBlockCipher serverWriteCipher, int cipherKeySize, int macSize)
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x0600B1E6 RID: 45542 RVA: 0x00266EB4 File Offset: 0x002650B4
|
||||
[Token(Token = "0x600B1E6")]
|
||||
[Address(RVA = "0x49AE60", Offset = "0x499E60", VA = "0x18049AE60")]
|
||||
internal TlsAeadCipher(TlsContext context, IAeadBlockCipher clientWriteCipher, IAeadBlockCipher serverWriteCipher, int cipherKeySize, int macSize, int nonceMode)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (0600B1E6)
|
||||
|
||||
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls.TlsAeadCipher::.ctor(BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls.TlsContext,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes.IAeadBlockCipher,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes.IAeadBlockCipher,System.Int32,System.Int32,System.Int32)
|
||||
|
||||
---> System.Exception: Basic block has to end with unconditional control flow.
|
||||
{
|
||||
IL_82:
|
||||
stloc:TlsFatalAlert(var_12_89, newobj:TlsFatalAlert(TlsFatalAlert::.ctor, ldloc:uint64[exp:uint8](var_13)))
|
||||
stloc:TlsFatalAlert(var_14_92, newobj:TlsFatalAlert(TlsFatalAlert::.ctor, ldloc:uint64[exp:uint8](var_15)))
|
||||
}
|
||||
|
||||
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
|
||||
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
|
||||
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
|
||||
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
|
||||
--- End of inner exception stack trace ---
|
||||
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
|
||||
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
|
||||
*/;
|
||||
}
|
||||
|
||||
// Token: 0x0600B1E7 RID: 45543 RVA: 0x00266F54 File Offset: 0x00265154
|
||||
[Token(Token = "0x600B1E7")]
|
||||
[Address(RVA = "0x49AE20", Offset = "0x499E20", VA = "0x18049AE20", Slot = "7")]
|
||||
public virtual int GetPlaintextLimit(int ciphertextLimit)
|
||||
{
|
||||
return ciphertextLimit;
|
||||
}
|
||||
|
||||
// Token: 0x0600B1E8 RID: 45544 RVA: 0x00266F64 File Offset: 0x00265164
|
||||
[Token(Token = "0x600B1E8")]
|
||||
[Address(RVA = "0x49A920", Offset = "0x499920", VA = "0x18049A920", Slot = "8")]
|
||||
public virtual byte[] EncodePlaintext(long seqNo, byte type, byte[] plaintext, int offset, int len)
|
||||
{
|
||||
byte[] array2;
|
||||
byte[] array4;
|
||||
for (;;)
|
||||
{
|
||||
byte[] array = this.encryptImplicitNonce;
|
||||
int num = this.record_iv_length;
|
||||
int length = array.Length;
|
||||
num += length;
|
||||
array2 = new byte[num];
|
||||
int num2 = this.nonceMode;
|
||||
if (num2 == 1)
|
||||
{
|
||||
byte[] array3 = this.encryptImplicitNonce;
|
||||
int length2 = array3.Length;
|
||||
int num3 = 0;
|
||||
int num4 = 0;
|
||||
Array.Copy(array3, num4, array2, num3, length2);
|
||||
int length3 = this.encryptImplicitNonce.Length;
|
||||
TlsUtilities.WriteUint64(seqNo, array2, length3);
|
||||
IAeadBlockCipher aeadBlockCipher = this.encryptCipher;
|
||||
int num5 = this.record_iv_length;
|
||||
num5 += num2;
|
||||
array4 = new byte[num5];
|
||||
int num6 = this.record_iv_length;
|
||||
if (num6 != 0)
|
||||
{
|
||||
int num7 = array2.Length;
|
||||
num7 -= num6;
|
||||
int num8 = 0;
|
||||
Array.Copy(array2, num7, array4, num8, num6);
|
||||
}
|
||||
int num9 = this.macSize;
|
||||
IAeadBlockCipher aeadBlockCipher2 = this.encryptCipher;
|
||||
IAeadBlockCipher aeadBlockCipher3 = this.encryptCipher;
|
||||
IAeadBlockCipher aeadBlockCipher4 = this.encryptCipher;
|
||||
AeadParameters aeadParameters;
|
||||
num9 += aeadParameters;
|
||||
if (num9 == array4.Length)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (num2 == 2)
|
||||
{
|
||||
goto Block_3;
|
||||
}
|
||||
}
|
||||
return array4;
|
||||
Block_3:
|
||||
int length4 = array2.Length;
|
||||
TlsUtilities.WriteUint64(seqNo, array2, length4);
|
||||
int num10 = 0;
|
||||
int i = 0;
|
||||
byte[] array5 = this.encryptImplicitNonce;
|
||||
while (i >= array5.Length)
|
||||
{
|
||||
}
|
||||
num10++;
|
||||
byte[] array6 = this.encryptImplicitNonce;
|
||||
throw new NullReferenceException();
|
||||
}
|
||||
|
||||
// Token: 0x0600B1E9 RID: 45545 RVA: 0x002670AC File Offset: 0x002652AC
|
||||
[Token(Token = "0x600B1E9")]
|
||||
[Address(RVA = "0x49A500", Offset = "0x499500", VA = "0x18049A500", Slot = "9")]
|
||||
public virtual byte[] DecodeCiphertext(long seqNo, byte type, byte[] ciphertext, int offset, int len)
|
||||
{
|
||||
byte[] array6;
|
||||
for (;;)
|
||||
{
|
||||
byte[] array = this.decryptImplicitNonce;
|
||||
int num = this.record_iv_length;
|
||||
int length = array.Length;
|
||||
num += length;
|
||||
byte[] array2 = new byte[num];
|
||||
int num2 = this.nonceMode;
|
||||
if (num2 == 1)
|
||||
{
|
||||
byte[] array3 = this.decryptImplicitNonce;
|
||||
int length2 = array3.Length;
|
||||
int num3 = 0;
|
||||
int num4 = 0;
|
||||
Array.Copy(array3, num4, array2, num3, length2);
|
||||
int num5 = this.record_iv_length;
|
||||
int num6 = array2.Length;
|
||||
num6 -= num5;
|
||||
Array.Copy(ciphertext, (int)seqNo, array2, num6, num5);
|
||||
}
|
||||
if (num2 == 2)
|
||||
{
|
||||
int length3 = array2.Length;
|
||||
TlsUtilities.WriteUint64(seqNo, array2, length3);
|
||||
int num7 = 0;
|
||||
int num8 = 0;
|
||||
byte[] array4 = this.decryptImplicitNonce;
|
||||
if (num8 < array4.Length)
|
||||
{
|
||||
num7++;
|
||||
byte[] array5 = this.decryptImplicitNonce;
|
||||
}
|
||||
int num9 = this.record_iv_length;
|
||||
IAeadBlockCipher aeadBlockCipher = this.decryptCipher;
|
||||
array6 = new byte[num9];
|
||||
IAeadBlockCipher aeadBlockCipher2 = this.decryptCipher;
|
||||
IAeadBlockCipher aeadBlockCipher3 = this.decryptCipher;
|
||||
IAeadBlockCipher aeadBlockCipher4 = this.decryptCipher;
|
||||
AeadParameters aeadParameters;
|
||||
aeadParameters += aeadParameters;
|
||||
if (aeadParameters == array6.Length)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return array6;
|
||||
}
|
||||
|
||||
// Token: 0x0600B1EA RID: 45546 RVA: 0x002671CC File Offset: 0x002653CC
|
||||
[Token(Token = "0x600B1EA")]
|
||||
[Address(RVA = "0x49AD20", Offset = "0x499D20", VA = "0x18049AD20", Slot = "10")]
|
||||
protected virtual byte[] GetAdditionalData(long seqNo, byte type, int len)
|
||||
{
|
||||
byte[] array = new byte[13];
|
||||
int num = 0;
|
||||
TlsUtilities.WriteUint64(seqNo, array, num);
|
||||
TlsUtilities.WriteUint8(type, array, 8);
|
||||
TlsContext tlsContext = this.context;
|
||||
PngHelperInternal.WriteInt2tobytes(len, array, 11);
|
||||
return array;
|
||||
}
|
||||
|
||||
// Token: 0x04007197 RID: 29079
|
||||
[Token(Token = "0x4007197")]
|
||||
public const int NONCE_RFC5288 = 1;
|
||||
|
||||
// Token: 0x04007198 RID: 29080
|
||||
[Token(Token = "0x4007198")]
|
||||
internal const int NONCE_DRAFT_CHACHA20_POLY1305 = 2;
|
||||
|
||||
// Token: 0x04007199 RID: 29081
|
||||
[FieldOffset(Offset = "0x10")]
|
||||
[Token(Token = "0x4007199")]
|
||||
protected readonly TlsContext context;
|
||||
|
||||
// Token: 0x0400719A RID: 29082
|
||||
[FieldOffset(Offset = "0x18")]
|
||||
[Token(Token = "0x400719A")]
|
||||
protected readonly int macSize;
|
||||
|
||||
// Token: 0x0400719B RID: 29083
|
||||
[FieldOffset(Offset = "0x1C")]
|
||||
[Token(Token = "0x400719B")]
|
||||
protected readonly int record_iv_length;
|
||||
|
||||
// Token: 0x0400719C RID: 29084
|
||||
[FieldOffset(Offset = "0x20")]
|
||||
[Token(Token = "0x400719C")]
|
||||
protected readonly IAeadBlockCipher encryptCipher;
|
||||
|
||||
// Token: 0x0400719D RID: 29085
|
||||
[FieldOffset(Offset = "0x28")]
|
||||
[Token(Token = "0x400719D")]
|
||||
protected readonly IAeadBlockCipher decryptCipher;
|
||||
|
||||
// Token: 0x0400719E RID: 29086
|
||||
[FieldOffset(Offset = "0x30")]
|
||||
[Token(Token = "0x400719E")]
|
||||
protected readonly byte[] encryptImplicitNonce;
|
||||
|
||||
// Token: 0x0400719F RID: 29087
|
||||
[FieldOffset(Offset = "0x38")]
|
||||
[Token(Token = "0x400719F")]
|
||||
protected readonly byte[] decryptImplicitNonce;
|
||||
|
||||
// Token: 0x040071A0 RID: 29088
|
||||
[FieldOffset(Offset = "0x40")]
|
||||
[Token(Token = "0x40071A0")]
|
||||
protected readonly int nonceMode;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user