185 lines
10 KiB
C#
185 lines
10 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.IO;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls
|
|
{
|
|
// Token: 0x02001BE2 RID: 7138
|
|
[Token(Token = "0x2001BE2")]
|
|
public class Certificate
|
|
{
|
|
// Token: 0x0600AFD3 RID: 45011 RVA: 0x0025FF40 File Offset: 0x0025E140
|
|
[Token(Token = "0x600AFD3")]
|
|
[Address(RVA = "0x2331A10", Offset = "0x2330A10", VA = "0x182331A10")]
|
|
public Certificate(X509CertificateStructure[] certificateList)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600AFD3)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls.Certificate::.ctor(BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509.X509CertificateStructure[])
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_12:
|
|
stloc:ArgumentNullException(var_0_1C, newobj:ArgumentNullException(ArgumentNullException::.ctor, ldstr:string("certificateList")))
|
|
}
|
|
|
|
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.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846
|
|
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: 0x0600AFD4 RID: 45012 RVA: 0x0000220F File Offset: 0x0000040F
|
|
[Token(Token = "0x600AFD4")]
|
|
[Address(RVA = "0xC8D4E0", Offset = "0xC8C4E0", VA = "0x180C8D4E0", Slot = "4")]
|
|
public virtual X509CertificateStructure[] GetCertificateList()
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x0600AFD5 RID: 45013 RVA: 0x0025FF6C File Offset: 0x0025E16C
|
|
[Token(Token = "0x600AFD5")]
|
|
[Address(RVA = "0x470B20", Offset = "0x46FB20", VA = "0x180470B20", Slot = "5")]
|
|
public virtual X509CertificateStructure GetCertificateAt(int index)
|
|
{
|
|
return this.mCertificateList[index];
|
|
}
|
|
|
|
// Token: 0x17001BE9 RID: 7145
|
|
// (get) Token: 0x0600AFD6 RID: 45014 RVA: 0x0025FF8C File Offset: 0x0025E18C
|
|
[Token(Token = "0x17001BE9")]
|
|
public virtual int Length
|
|
{
|
|
[Token(Token = "0x600AFD6")]
|
|
[Address(RVA = "0x73E8F0", Offset = "0x73D8F0", VA = "0x18073E8F0", Slot = "6")]
|
|
get
|
|
{
|
|
return this.mCertificateList.Length;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001BEA RID: 7146
|
|
// (get) Token: 0x0600AFD7 RID: 45015 RVA: 0x0025FFAC File Offset: 0x0025E1AC
|
|
[Token(Token = "0x17001BEA")]
|
|
public virtual bool IsEmpty
|
|
{
|
|
[Token(Token = "0x600AFD7")]
|
|
[Address(RVA = "0x2331A90", Offset = "0x2330A90", VA = "0x182331A90", Slot = "7")]
|
|
get
|
|
{
|
|
return this.mCertificateList.Length == 0;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600AFD8 RID: 45016 RVA: 0x0025FFD0 File Offset: 0x0025E1D0
|
|
[Token(Token = "0x600AFD8")]
|
|
[Address(RVA = "0x2331170", Offset = "0x2330170", VA = "0x182331170", Slot = "8")]
|
|
public virtual void Encode(Stream output)
|
|
{
|
|
int num;
|
|
do
|
|
{
|
|
num = 0;
|
|
IList list = Platform.CreateArrayList(this.mCertificateList.Length);
|
|
X509CertificateStructure[] array = this.mCertificateList;
|
|
int length = array.Length;
|
|
if (num < length)
|
|
{
|
|
X509CertificateStructure x509CertificateStructure = array[num];
|
|
int num2 = 0;
|
|
byte[] encoded = x509CertificateStructure.GetEncoded("DER");
|
|
if (num < num2)
|
|
{
|
|
num += num;
|
|
num++;
|
|
}
|
|
num += 3;
|
|
num++;
|
|
num += num;
|
|
}
|
|
TlsUtilities.CheckUint24(num);
|
|
TlsUtilities.WriteUint24(num, output);
|
|
if (num < list)
|
|
{
|
|
num += num;
|
|
num++;
|
|
}
|
|
int num3 = 0;
|
|
if (list != 0)
|
|
{
|
|
if (num < num3)
|
|
{
|
|
num += num;
|
|
num++;
|
|
}
|
|
num += 19;
|
|
num++;
|
|
num += 19;
|
|
}
|
|
if (num != 0)
|
|
{
|
|
}
|
|
}
|
|
while (num != 0);
|
|
}
|
|
|
|
// Token: 0x0600AFD9 RID: 45017 RVA: 0x00260084 File Offset: 0x0025E284
|
|
[Token(Token = "0x600AFD9")]
|
|
[Address(RVA = "0x2331520", Offset = "0x2330520", VA = "0x182331520")]
|
|
public static Certificate Parse(Stream input)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600AFD9)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls.Certificate BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls.Certificate::Parse(System.IO.Stream)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_D1:
|
|
stloc:ArgumentNullException(var_15_DB, newobj:ArgumentNullException(ArgumentNullException::.ctor, ldstr:string("certificateList")))
|
|
}
|
|
|
|
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.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846
|
|
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: 0x0600AFDA RID: 45018 RVA: 0x00260170 File Offset: 0x0025E370
|
|
[Token(Token = "0x600AFDA")]
|
|
[Address(RVA = "0x23310F0", Offset = "0x23300F0", VA = "0x1823310F0", Slot = "9")]
|
|
protected virtual X509CertificateStructure[] CloneCertificateList()
|
|
{
|
|
X509CertificateStructure[] array = this.mCertificateList;
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x04006EC1 RID: 28353
|
|
[Token(Token = "0x4006EC1")]
|
|
public static readonly Certificate EmptyChain = new Certificate(new X509CertificateStructure[0]);
|
|
|
|
// Token: 0x04006EC2 RID: 28354
|
|
[FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x4006EC2")]
|
|
protected readonly X509CertificateStructure[] mCertificateList;
|
|
}
|
|
}
|