190 lines
10 KiB
C#
190 lines
10 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.IO;
|
|
using System.Runtime.InteropServices;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls
|
|
{
|
|
// Token: 0x02001525 RID: 5413
|
|
[Token(Token = "0x2001525")]
|
|
[StructLayout(3)]
|
|
public class Certificate
|
|
{
|
|
// Token: 0x0600902B RID: 36907 RVA: 0x001FF7F0 File Offset: 0x001FD9F0
|
|
[Token(Token = "0x600902B")]
|
|
[Address(RVA = "0x1E776C0", Offset = "0x1E760C0", VA = "0x181E776C0")]
|
|
public Certificate(X509CertificateStructure[] certificateList)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600902B)
|
|
|
|
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: 0x0600902C RID: 36908 RVA: 0x0000220F File Offset: 0x0000040F
|
|
[Token(Token = "0x600902C")]
|
|
[Address(RVA = "0x9E3670", Offset = "0x9E2070", VA = "0x1809E3670", Slot = "4")]
|
|
public virtual X509CertificateStructure[] GetCertificateList()
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x0600902D RID: 36909 RVA: 0x001FF81C File Offset: 0x001FDA1C
|
|
[Token(Token = "0x600902D")]
|
|
[Address(RVA = "0x4F7610", Offset = "0x4F6010", VA = "0x1804F7610", Slot = "5")]
|
|
public virtual X509CertificateStructure GetCertificateAt(int index)
|
|
{
|
|
return this.mCertificateList[index];
|
|
}
|
|
|
|
// Token: 0x1700174B RID: 5963
|
|
// (get) Token: 0x0600902E RID: 36910 RVA: 0x001FF83C File Offset: 0x001FDA3C
|
|
[Token(Token = "0x1700174B")]
|
|
public virtual int Length
|
|
{
|
|
[Token(Token = "0x600902E")]
|
|
[Address(RVA = "0x5FE710", Offset = "0x5FD110", VA = "0x1805FE710", Slot = "6")]
|
|
get
|
|
{
|
|
return this.mCertificateList.Length;
|
|
}
|
|
}
|
|
|
|
// Token: 0x1700174C RID: 5964
|
|
// (get) Token: 0x0600902F RID: 36911 RVA: 0x001FF85C File Offset: 0x001FDA5C
|
|
[Token(Token = "0x1700174C")]
|
|
public virtual bool IsEmpty
|
|
{
|
|
[Token(Token = "0x600902F")]
|
|
[Address(RVA = "0x5FE6F0", Offset = "0x5FD0F0", VA = "0x1805FE6F0", Slot = "7")]
|
|
get
|
|
{
|
|
return this.mCertificateList.Length == 0;
|
|
}
|
|
}
|
|
|
|
// Token: 0x06009030 RID: 36912 RVA: 0x001FF880 File Offset: 0x001FDA80
|
|
[Token(Token = "0x6009030")]
|
|
[Address(RVA = "0x1E76E00", Offset = "0x1E75800", VA = "0x181E76E00", 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)
|
|
{
|
|
}
|
|
if (num != -1)
|
|
{
|
|
}
|
|
}
|
|
while (num != 0);
|
|
}
|
|
|
|
// Token: 0x06009031 RID: 36913 RVA: 0x001FF938 File Offset: 0x001FDB38
|
|
[Token(Token = "0x6009031")]
|
|
[Address(RVA = "0x1E771D0", Offset = "0x1E75BD0", VA = "0x181E771D0")]
|
|
public static Certificate Parse(Stream input)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (06009031)
|
|
|
|
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: 0x06009032 RID: 36914 RVA: 0x001FFA24 File Offset: 0x001FDC24
|
|
[Token(Token = "0x6009032")]
|
|
[Address(RVA = "0x1E76D80", Offset = "0x1E75780", VA = "0x181E76D80", Slot = "9")]
|
|
protected virtual X509CertificateStructure[] CloneCertificateList()
|
|
{
|
|
X509CertificateStructure[] array = this.mCertificateList;
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x04005EC5 RID: 24261
|
|
[Token(Token = "0x4005EC5")]
|
|
public static readonly Certificate EmptyChain = new Certificate(new X509CertificateStructure[0]);
|
|
|
|
// Token: 0x04005EC6 RID: 24262
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x4005EC6")]
|
|
protected readonly X509CertificateStructure[] mCertificateList;
|
|
}
|
|
}
|