315 lines
12 KiB
C#
315 lines
12 KiB
C#
using System;
|
|
using System.Runtime.InteropServices;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls
|
|
{
|
|
// Token: 0x0200156A RID: 5482
|
|
[Token(Token = "0x200156A")]
|
|
[StructLayout(3)]
|
|
public sealed class ProtocolVersion
|
|
{
|
|
// Token: 0x06009192 RID: 37266 RVA: 0x00204B34 File Offset: 0x00202D34
|
|
[Token(Token = "0x6009192")]
|
|
[Address(RVA = "0x1E89760", Offset = "0x1E88160", VA = "0x181E89760")]
|
|
private ProtocolVersion(int v, string name)
|
|
{
|
|
this.name = name;
|
|
this.version = v;
|
|
}
|
|
|
|
// Token: 0x17001772 RID: 6002
|
|
// (get) Token: 0x06009193 RID: 37267 RVA: 0x00204B58 File Offset: 0x00202D58
|
|
[Token(Token = "0x17001772")]
|
|
public int FullVersion
|
|
{
|
|
[Token(Token = "0x6009193")]
|
|
[Address(RVA = "0x3C1C50", Offset = "0x3C0650", VA = "0x1803C1C50")]
|
|
get
|
|
{
|
|
return this.version;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001773 RID: 6003
|
|
// (get) Token: 0x06009194 RID: 37268 RVA: 0x00204B6C File Offset: 0x00202D6C
|
|
[Token(Token = "0x17001773")]
|
|
public int MajorVersion
|
|
{
|
|
[Token(Token = "0x6009194")]
|
|
[Address(RVA = "0x1E89840", Offset = "0x1E88240", VA = "0x181E89840")]
|
|
get
|
|
{
|
|
return this.version;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001774 RID: 6004
|
|
// (get) Token: 0x06009195 RID: 37269 RVA: 0x00204B80 File Offset: 0x00202D80
|
|
[Token(Token = "0x17001774")]
|
|
public int MinorVersion
|
|
{
|
|
[Token(Token = "0x6009195")]
|
|
[Address(RVA = "0x559440", Offset = "0x557E40", VA = "0x180559440")]
|
|
get
|
|
{
|
|
return this.version;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001775 RID: 6005
|
|
// (get) Token: 0x06009196 RID: 37270 RVA: 0x00204B94 File Offset: 0x00202D94
|
|
[Token(Token = "0x17001775")]
|
|
public bool IsDtls
|
|
{
|
|
[Token(Token = "0x6009196")]
|
|
[Address(RVA = "0x1E897A0", Offset = "0x1E881A0", VA = "0x181E897A0")]
|
|
get
|
|
{
|
|
return this.version == 65024;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001776 RID: 6006
|
|
// (get) Token: 0x06009197 RID: 37271 RVA: 0x00204BB0 File Offset: 0x00202DB0
|
|
[Token(Token = "0x17001776")]
|
|
public bool IsSsl
|
|
{
|
|
[Token(Token = "0x6009197")]
|
|
[Address(RVA = "0x1E897C0", Offset = "0x1E881C0", VA = "0x181E897C0")]
|
|
get
|
|
{
|
|
return this == "{il2cpp field on {'constant10' (constant value of type Cpp2IL.Core.Analysis.ResultModels.StaticFieldsPtr)}, offset 0x0}";
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001777 RID: 6007
|
|
// (get) Token: 0x06009198 RID: 37272 RVA: 0x00204BC8 File Offset: 0x00202DC8
|
|
[Token(Token = "0x17001777")]
|
|
public bool IsTls
|
|
{
|
|
[Token(Token = "0x6009198")]
|
|
[Address(RVA = "0x1E89820", Offset = "0x1E88220", VA = "0x181E89820")]
|
|
get
|
|
{
|
|
return this.version == 768;
|
|
}
|
|
}
|
|
|
|
// Token: 0x06009199 RID: 37273 RVA: 0x00204BE4 File Offset: 0x00202DE4
|
|
[Token(Token = "0x6009199")]
|
|
[Address(RVA = "0x1E89030", Offset = "0x1E87A30", VA = "0x181E89030")]
|
|
public ProtocolVersion GetEquivalentTLSVersion()
|
|
{
|
|
if (this.version == 65024)
|
|
{
|
|
return ProtocolVersion.TLSv12;
|
|
}
|
|
return this;
|
|
}
|
|
|
|
// Token: 0x0600919A RID: 37274 RVA: 0x00204C0C File Offset: 0x00202E0C
|
|
[Token(Token = "0x600919A")]
|
|
[Address(RVA = "0x1E89500", Offset = "0x1E87F00", VA = "0x181E89500")]
|
|
public bool IsEqualOrEarlierVersionOf(ProtocolVersion version)
|
|
{
|
|
int num = version.version;
|
|
int num2 = this.version;
|
|
if (num2 == num)
|
|
{
|
|
num = num2;
|
|
num2 = num;
|
|
num2 -= num;
|
|
if (num2 == 254)
|
|
{
|
|
return num2 <= 0;
|
|
}
|
|
}
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0600919B RID: 37275 RVA: 0x00204C4C File Offset: 0x00202E4C
|
|
[Token(Token = "0x600919B")]
|
|
[Address(RVA = "0x1E89560", Offset = "0x1E87F60", VA = "0x181E89560")]
|
|
public bool IsLaterVersionOf(ProtocolVersion version)
|
|
{
|
|
int num = version.version;
|
|
int num2 = this.version;
|
|
if (num2 == num)
|
|
{
|
|
num = num2;
|
|
num2 = num;
|
|
num2 -= num;
|
|
if (num2 == 254)
|
|
{
|
|
return num2 > 0;
|
|
}
|
|
}
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0600919C RID: 37276 RVA: 0x00204C8C File Offset: 0x00202E8C
|
|
[Token(Token = "0x600919C")]
|
|
[Address(RVA = "0x1E88F90", Offset = "0x1E87990", VA = "0x181E88F90", Slot = "0")]
|
|
public override bool Equals(object other)
|
|
{
|
|
while (this != other)
|
|
{
|
|
if (other != 0 && other != 0)
|
|
{
|
|
if (other != 0)
|
|
{
|
|
return this.TLSv11 == other;
|
|
}
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
|
|
// Token: 0x0600919D RID: 37277 RVA: 0x00204CB8 File Offset: 0x00202EB8
|
|
[Token(Token = "0x600919D")]
|
|
[Address(RVA = "0x1E88F70", Offset = "0x1E87970", VA = "0x181E88F70")]
|
|
public bool Equals(ProtocolVersion other)
|
|
{
|
|
if (other == 0)
|
|
{
|
|
}
|
|
int num = other.version;
|
|
return this.TLSv11 == num;
|
|
}
|
|
|
|
// Token: 0x0600919E RID: 37278 RVA: 0x00204CDC File Offset: 0x00202EDC
|
|
[Token(Token = "0x600919E")]
|
|
[Address(RVA = "0x3C1C50", Offset = "0x3C0650", VA = "0x1803C1C50", Slot = "2")]
|
|
public override int GetHashCode()
|
|
{
|
|
return this.version;
|
|
}
|
|
|
|
// Token: 0x0600919F RID: 37279 RVA: 0x00204CF0 File Offset: 0x00202EF0
|
|
[Token(Token = "0x600919F")]
|
|
[Address(RVA = "0x1E89230", Offset = "0x1E87C30", VA = "0x181E89230")]
|
|
public static ProtocolVersion Get(int major, int minor)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600919F)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls.ProtocolVersion BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls.ProtocolVersion::Get(System.Int32,System.Int32)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_5A:
|
|
stloc:TlsFatalAlert(var_1_60, newobj:TlsFatalAlert(TlsFatalAlert::.ctor, ldloc:uint64[exp:uint8](var_2)))
|
|
}
|
|
|
|
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.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: 0x060091A0 RID: 37280 RVA: 0x00204D60 File Offset: 0x00202F60
|
|
[Token(Token = "0x60091A0")]
|
|
[Address(RVA = "0x3C1240", Offset = "0x3BFC40", VA = "0x1803C1240", Slot = "3")]
|
|
public override string ToString()
|
|
{
|
|
return this.name;
|
|
}
|
|
|
|
// Token: 0x060091A1 RID: 37281 RVA: 0x00204D74 File Offset: 0x00202F74
|
|
[Token(Token = "0x60091A1")]
|
|
[Address(RVA = "0x1E89100", Offset = "0x1E87B00", VA = "0x181E89100")]
|
|
private static ProtocolVersion GetUnknownVersion(int major, int minor, string prefix)
|
|
{
|
|
TlsUtilities.CheckUint8(major);
|
|
TlsUtilities.CheckUint8(major);
|
|
string text = Platform.ToUpperInvariant(Convert.ToString(major, 16).Substring(1));
|
|
int num = 0;
|
|
string text2 = prefix + " 0x" + text;
|
|
int num2 = 0;
|
|
ProtocolVersion protocolVersion;
|
|
protocolVersion.FieldGetter(num2, text, num);
|
|
protocolVersion.version = major;
|
|
protocolVersion.name = text2;
|
|
return protocolVersion;
|
|
}
|
|
|
|
// Token: 0x060091A2 RID: 37282 RVA: 0x00204DD4 File Offset: 0x00202FD4
|
|
// Note: this type is marked as 'beforefieldinit'.
|
|
[Token(Token = "0x60091A2")]
|
|
[Address(RVA = "0x1E895C0", Offset = "0x1E87FC0", VA = "0x181E895C0")]
|
|
static ProtocolVersion()
|
|
{
|
|
ProtocolVersion protocolVersion;
|
|
protocolVersion.version = (int)((ulong)768L);
|
|
protocolVersion.name = "SSL 3.0";
|
|
ProtocolVersion.SSLv3 = protocolVersion;
|
|
ProtocolVersion protocolVersion2;
|
|
protocolVersion2.version = (int)((ulong)769L);
|
|
protocolVersion2.name = "TLS 1.0";
|
|
ProtocolVersion.TLSv10 = protocolVersion2;
|
|
ProtocolVersion protocolVersion3;
|
|
protocolVersion3.version = (int)((ulong)770L);
|
|
protocolVersion3.name = "TLS 1.1";
|
|
ProtocolVersion.TLSv11 = protocolVersion3;
|
|
ProtocolVersion protocolVersion4;
|
|
protocolVersion4.version = (int)((ulong)771L);
|
|
protocolVersion4.name = "TLS 1.2";
|
|
ProtocolVersion.TLSv12 = protocolVersion4;
|
|
ProtocolVersion protocolVersion5;
|
|
protocolVersion5.version = (int)((ulong)65279L);
|
|
protocolVersion5.name = "DTLS 1.0";
|
|
ProtocolVersion.DTLSv10 = protocolVersion5;
|
|
ProtocolVersion protocolVersion6;
|
|
protocolVersion6.name = "DTLS 1.2";
|
|
protocolVersion6.version = (int)((ulong)65277L);
|
|
ProtocolVersion.DTLSv12 = protocolVersion6;
|
|
}
|
|
|
|
// Token: 0x0400612C RID: 24876
|
|
[Token(Token = "0x400612C")]
|
|
public static readonly ProtocolVersion SSLv3;
|
|
|
|
// Token: 0x0400612D RID: 24877
|
|
[Token(Token = "0x400612D")]
|
|
public static readonly ProtocolVersion TLSv10;
|
|
|
|
// Token: 0x0400612E RID: 24878
|
|
[Token(Token = "0x400612E")]
|
|
public static readonly ProtocolVersion TLSv11;
|
|
|
|
// Token: 0x0400612F RID: 24879
|
|
[Token(Token = "0x400612F")]
|
|
public static readonly ProtocolVersion TLSv12;
|
|
|
|
// Token: 0x04006130 RID: 24880
|
|
[Token(Token = "0x4006130")]
|
|
public static readonly ProtocolVersion DTLSv10;
|
|
|
|
// Token: 0x04006131 RID: 24881
|
|
[Token(Token = "0x4006131")]
|
|
public static readonly ProtocolVersion DTLSv12;
|
|
|
|
// Token: 0x04006132 RID: 24882
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x4006132")]
|
|
private readonly int version;
|
|
|
|
// Token: 0x04006133 RID: 24883
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x4006133")]
|
|
private readonly string name;
|
|
}
|
|
}
|