351 lines
16 KiB
C#
351 lines
16 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls
|
|
{
|
|
// Token: 0x02001BD2 RID: 7122
|
|
[Token(Token = "0x2001BD2")]
|
|
public abstract class AbstractTlsClient : AbstractTlsPeer, TlsClient, TlsPeer
|
|
{
|
|
// Token: 0x17001BCE RID: 7118
|
|
// (get) Token: 0x0600AF2F RID: 44847 RVA: 0x0025EB34 File Offset: 0x0025CD34
|
|
// (set) Token: 0x0600AF30 RID: 44848 RVA: 0x0025EB48 File Offset: 0x0025CD48
|
|
[Token(Token = "0x17001BCE")]
|
|
public List<string> HostNames
|
|
{
|
|
[Token(Token = "0x600AF2F")]
|
|
[Address(RVA = "0x4975A0", Offset = "0x4965A0", VA = "0x1804975A0", Slot = "20")]
|
|
get;
|
|
[Token(Token = "0x600AF30")]
|
|
[Address(RVA = "0x55BCF0", Offset = "0x55ACF0", VA = "0x18055BCF0", Slot = "21")]
|
|
set;
|
|
}
|
|
|
|
// Token: 0x0600AF31 RID: 44849 RVA: 0x0025EB5C File Offset: 0x0025CD5C
|
|
[Token(Token = "0x600AF31")]
|
|
[Address(RVA = "0x232BE20", Offset = "0x232AE20", VA = "0x18232BE20")]
|
|
public AbstractTlsClient()
|
|
{
|
|
DefaultTlsCipherFactory defaultTlsCipherFactory = new DefaultTlsCipherFactory();
|
|
int num = 0;
|
|
this.NotifyNewSessionTicket(num);
|
|
this.mCipherFactory = defaultTlsCipherFactory;
|
|
}
|
|
|
|
// Token: 0x0600AF32 RID: 44850 RVA: 0x0025EB80 File Offset: 0x0025CD80
|
|
[Token(Token = "0x600AF32")]
|
|
[Address(RVA = "0x493D90", Offset = "0x492D90", VA = "0x180493D90")]
|
|
public AbstractTlsClient(TlsCipherFactory cipherFactory)
|
|
{
|
|
int num = 0;
|
|
this.NotifyNewSessionTicket(num);
|
|
this.mCipherFactory = cipherFactory;
|
|
}
|
|
|
|
// Token: 0x0600AF33 RID: 44851 RVA: 0x0025EBA0 File Offset: 0x0025CDA0
|
|
[Token(Token = "0x600AF33")]
|
|
[Address(RVA = "0x232B5C0", Offset = "0x232A5C0", VA = "0x18232B5C0", Slot = "40")]
|
|
protected virtual bool AllowUnexpectedServerExtension(int extensionType, byte[] extensionData)
|
|
{
|
|
if (extensionType == 10)
|
|
{
|
|
int[] array = TlsEccUtilities.ReadSupportedEllipticCurvesExtension(extensionData);
|
|
return true;
|
|
}
|
|
if (extensionType == 11)
|
|
{
|
|
byte[] array2 = TlsEccUtilities.ReadSupportedPointFormatsExtension(extensionData);
|
|
return true;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600AF34 RID: 44852 RVA: 0x0025EBCC File Offset: 0x0025CDCC
|
|
[Token(Token = "0x600AF34")]
|
|
[Address(RVA = "0x232B670", Offset = "0x232A670", VA = "0x18232B670", Slot = "41")]
|
|
protected virtual void CheckForUnexpectedServerExtension(IDictionary serverExtensions, int extensionType)
|
|
{
|
|
byte[] extensionData;
|
|
do
|
|
{
|
|
extensionData = TlsUtilities.GetExtensionData(serverExtensions, extensionType);
|
|
}
|
|
while (extensionData != 0 && extensionData == 0);
|
|
}
|
|
|
|
// Token: 0x0600AF35 RID: 44853 RVA: 0x0025EBEC File Offset: 0x0025CDEC
|
|
[Token(Token = "0x600AF35")]
|
|
[Address(RVA = "0x4157F0", Offset = "0x4147F0", VA = "0x1804157F0", Slot = "42")]
|
|
public virtual void Init(TlsClientContext context)
|
|
{
|
|
this.mContext = context;
|
|
}
|
|
|
|
// Token: 0x0600AF36 RID: 44854 RVA: 0x0025EC00 File Offset: 0x0025CE00
|
|
[Token(Token = "0x600AF36")]
|
|
[Address(RVA = "0x4242C0", Offset = "0x4232C0", VA = "0x1804242C0", Slot = "43")]
|
|
public virtual TlsSession GetSessionToResume()
|
|
{
|
|
}
|
|
|
|
// Token: 0x17001BCF RID: 7119
|
|
// (get) Token: 0x0600AF37 RID: 44855 RVA: 0x0025EC10 File Offset: 0x0025CE10
|
|
[Token(Token = "0x17001BCF")]
|
|
public virtual ProtocolVersion ClientHelloRecordLayerVersion
|
|
{
|
|
[Token(Token = "0x600AF37")]
|
|
[Address(RVA = "0x19AF360", Offset = "0x19AE360", VA = "0x1819AF360", Slot = "44")]
|
|
get
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600AF37)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls.ProtocolVersion BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls.AbstractTlsClient::get_ClientHelloRecordLayerVersion()
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
Block_0:
|
|
stloc:int32[](var_0_06, call:int32[](AbstractTlsClient::GetCipherSuites, ldloc:AbstractTlsClient(this)))
|
|
}
|
|
|
|
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: 0x17001BD0 RID: 7120
|
|
// (get) Token: 0x0600AF38 RID: 44856 RVA: 0x0025EC24 File Offset: 0x0025CE24
|
|
[Token(Token = "0x17001BD0")]
|
|
public virtual ProtocolVersion ClientVersion
|
|
{
|
|
[Token(Token = "0x600AF38")]
|
|
[Address(RVA = "0x232BE80", Offset = "0x232AE80", VA = "0x18232BE80", Slot = "45")]
|
|
get
|
|
{
|
|
return ProtocolVersion.TLSv12;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001BD1 RID: 7121
|
|
// (get) Token: 0x0600AF39 RID: 44857 RVA: 0x0025EC38 File Offset: 0x0025CE38
|
|
[Token(Token = "0x17001BD1")]
|
|
public virtual bool IsFallback
|
|
{
|
|
[Token(Token = "0x600AF39")]
|
|
[Address(RVA = "0x424690", Offset = "0x423690", VA = "0x180424690", Slot = "46")]
|
|
get
|
|
{
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600AF3A RID: 44858 RVA: 0x0000220F File Offset: 0x0000040F
|
|
[Token(Token = "0x600AF3A")]
|
|
[Address(RVA = "0x232B7D0", Offset = "0x232A7D0", VA = "0x18232B7D0", Slot = "47")]
|
|
public virtual IDictionary GetClientExtensions()
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x17001BD2 RID: 7122
|
|
// (get) Token: 0x0600AF3B RID: 44859 RVA: 0x0025EC48 File Offset: 0x0025CE48
|
|
[Token(Token = "0x17001BD2")]
|
|
public virtual ProtocolVersion MinimumVersion
|
|
{
|
|
[Token(Token = "0x600AF3B")]
|
|
[Address(RVA = "0x232BEE0", Offset = "0x232AEE0", VA = "0x18232BEE0", Slot = "48")]
|
|
get
|
|
{
|
|
return ProtocolVersion.TLSv10;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600AF3C RID: 44860 RVA: 0x0025EC5C File Offset: 0x0025CE5C
|
|
[Token(Token = "0x600AF3C")]
|
|
[Address(RVA = "0x232BC00", Offset = "0x232AC00", VA = "0x18232BC00", Slot = "49")]
|
|
public virtual void NotifyServerVersion(ProtocolVersion serverVersion)
|
|
{
|
|
bool flag;
|
|
do
|
|
{
|
|
IDictionary clientExtensions = this.GetClientExtensions();
|
|
}
|
|
while (!flag);
|
|
}
|
|
|
|
// Token: 0x0600AF3D RID: 44861
|
|
[Token(Token = "0x600AF3D")]
|
|
[Address(Slot = "50")]
|
|
public abstract int[] GetCipherSuites();
|
|
|
|
// Token: 0x0600AF3E RID: 44862 RVA: 0x0000220F File Offset: 0x0000040F
|
|
[Token(Token = "0x600AF3E")]
|
|
[Address(RVA = "0x232BB00", Offset = "0x232AB00", VA = "0x18232BB00", Slot = "51")]
|
|
public virtual byte[] GetCompressionMethods()
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x0600AF3F RID: 44863 RVA: 0x0000220F File Offset: 0x0000040F
|
|
[Token(Token = "0x600AF3F")]
|
|
[Address(RVA = "0x4242D0", Offset = "0x4232D0", VA = "0x1804242D0", Slot = "52")]
|
|
public virtual void NotifySessionID(byte[] sessionID)
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x0600AF40 RID: 44864 RVA: 0x0025EC74 File Offset: 0x0025CE74
|
|
[Token(Token = "0x600AF40")]
|
|
[Address(RVA = "0x678D30", Offset = "0x677D30", VA = "0x180678D30", Slot = "53")]
|
|
public virtual void NotifySelectedCipherSuite(int selectedCipherSuite)
|
|
{
|
|
this.mSelectedCipherSuite = selectedCipherSuite;
|
|
}
|
|
|
|
// Token: 0x0600AF41 RID: 44865 RVA: 0x0025EC88 File Offset: 0x0025CE88
|
|
[Token(Token = "0x600AF41")]
|
|
[Address(RVA = "0x232BBF0", Offset = "0x232ABF0", VA = "0x18232BBF0", Slot = "54")]
|
|
public virtual void NotifySelectedCompressionMethod(byte selectedCompressionMethod)
|
|
{
|
|
this.mSelectedCompressionMethod = (short)selectedCompressionMethod;
|
|
}
|
|
|
|
// Token: 0x0600AF42 RID: 44866 RVA: 0x0025EC9C File Offset: 0x0025CE9C
|
|
[Token(Token = "0x600AF42")]
|
|
[Address(RVA = "0x232BCA0", Offset = "0x232ACA0", VA = "0x18232BCA0", Slot = "55")]
|
|
public virtual void ProcessServerExtensions(IDictionary serverExtensions)
|
|
{
|
|
if (serverExtensions != 0)
|
|
{
|
|
if (!TlsEccUtilities.IsEccCipherSuite(this.mSelectedCipherSuite))
|
|
{
|
|
}
|
|
byte[] supportedPointFormatsExtension = TlsEccUtilities.GetSupportedPointFormatsExtension(serverExtensions);
|
|
this.mServerECPointFormats = supportedPointFormatsExtension;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600AF43 RID: 44867 RVA: 0x0025ECCC File Offset: 0x0025CECC
|
|
[Token(Token = "0x600AF43")]
|
|
[Address(RVA = "0x232BDC0", Offset = "0x232ADC0", VA = "0x18232BDC0", Slot = "56")]
|
|
public virtual void ProcessServerSupplementalData(IList serverSupplementalData)
|
|
{
|
|
while (serverSupplementalData != 0)
|
|
{
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600AF44 RID: 44868
|
|
[Token(Token = "0x600AF44")]
|
|
[Address(Slot = "57")]
|
|
public abstract TlsKeyExchange GetKeyExchange();
|
|
|
|
// Token: 0x0600AF45 RID: 44869
|
|
[Token(Token = "0x600AF45")]
|
|
[Address(Slot = "58")]
|
|
public abstract TlsAuthentication GetAuthentication();
|
|
|
|
// Token: 0x0600AF46 RID: 44870 RVA: 0x0025ECE0 File Offset: 0x0025CEE0
|
|
[Token(Token = "0x600AF46")]
|
|
[Address(RVA = "0x4242C0", Offset = "0x4232C0", VA = "0x1804242C0", Slot = "59")]
|
|
public virtual IList GetClientSupplementalData()
|
|
{
|
|
}
|
|
|
|
// Token: 0x0600AF47 RID: 44871 RVA: 0x0025ECF0 File Offset: 0x0025CEF0
|
|
[Token(Token = "0x600AF47")]
|
|
[Address(RVA = "0x232BB40", Offset = "0x232AB40", VA = "0x18232BB40", Slot = "15")]
|
|
public override TlsCompression GetCompression()
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600AF47)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls.TlsCompression BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls.AbstractTlsClient::GetCompression()
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
Block_0:
|
|
stloc:int16(var_0_06, ldfld:int16(AbstractTlsClient::mSelectedCompressionMethod, ldloc:AbstractTlsClient(this)))
|
|
stloc:TlsNullCompression(var_1_0C, newobj:TlsNullCompression(TlsNullCompression::.ctor))
|
|
stloc:TlsDeflateCompression(var_2_12, newobj:TlsDeflateCompression(TlsDeflateCompression::.ctor))
|
|
}
|
|
|
|
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: 0x0600AF48 RID: 44872 RVA: 0x0025ED10 File Offset: 0x0025CF10
|
|
[Token(Token = "0x600AF48")]
|
|
[Address(RVA = "0x232B730", Offset = "0x232A730", VA = "0x18232B730", Slot = "16")]
|
|
public override TlsCipher GetCipher()
|
|
{
|
|
int num = this.mSelectedCipherSuite;
|
|
int encryptionAlgorithm = TlsUtilities.GetEncryptionAlgorithm(num);
|
|
int num2 = this.mSelectedCipherSuite;
|
|
int macAlgorithm = TlsUtilities.GetMacAlgorithm(num2);
|
|
TlsCipherFactory tlsCipherFactory = this.mCipherFactory;
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0600AF49 RID: 44873 RVA: 0x0000220F File Offset: 0x0000040F
|
|
[Token(Token = "0x600AF49")]
|
|
[Address(RVA = "0x4242D0", Offset = "0x4232D0", VA = "0x1804242D0", Slot = "60")]
|
|
public virtual void NotifyNewSessionTicket(NewSessionTicket newSessionTicket)
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x04006E67 RID: 28263
|
|
[FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x4006E67")]
|
|
protected TlsCipherFactory mCipherFactory;
|
|
|
|
// Token: 0x04006E68 RID: 28264
|
|
[FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x4006E68")]
|
|
protected TlsClientContext mContext;
|
|
|
|
// Token: 0x04006E69 RID: 28265
|
|
[FieldOffset(Offset = "0x20")]
|
|
[Token(Token = "0x4006E69")]
|
|
protected IList mSupportedSignatureAlgorithms;
|
|
|
|
// Token: 0x04006E6A RID: 28266
|
|
[FieldOffset(Offset = "0x28")]
|
|
[Token(Token = "0x4006E6A")]
|
|
protected int[] mNamedCurves;
|
|
|
|
// Token: 0x04006E6B RID: 28267
|
|
[FieldOffset(Offset = "0x30")]
|
|
[Token(Token = "0x4006E6B")]
|
|
protected byte[] mClientECPointFormats;
|
|
|
|
// Token: 0x04006E6C RID: 28268
|
|
[FieldOffset(Offset = "0x38")]
|
|
[Token(Token = "0x4006E6C")]
|
|
protected byte[] mServerECPointFormats;
|
|
|
|
// Token: 0x04006E6D RID: 28269
|
|
[FieldOffset(Offset = "0x40")]
|
|
[Token(Token = "0x4006E6D")]
|
|
protected int mSelectedCipherSuite;
|
|
|
|
// Token: 0x04006E6E RID: 28270
|
|
[FieldOffset(Offset = "0x44")]
|
|
[Token(Token = "0x4006E6E")]
|
|
protected short mSelectedCompressionMethod;
|
|
}
|
|
}
|