313 lines
12 KiB
C#
313 lines
12 KiB
C#
using System;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls
|
|
{
|
|
// Token: 0x02001C27 RID: 7207
|
|
[Token(Token = "0x2001C27")]
|
|
public sealed class ProtocolVersion
|
|
{
|
|
// Token: 0x0600B13A RID: 45370 RVA: 0x00265200 File Offset: 0x00263400
|
|
[Token(Token = "0x600B13A")]
|
|
[Address(RVA = "0x495A70", Offset = "0x494A70", VA = "0x180495A70")]
|
|
private ProtocolVersion(int v, string name)
|
|
{
|
|
this.name = name;
|
|
this.version = v;
|
|
}
|
|
|
|
// Token: 0x17001C10 RID: 7184
|
|
// (get) Token: 0x0600B13B RID: 45371 RVA: 0x00265224 File Offset: 0x00263424
|
|
[Token(Token = "0x17001C10")]
|
|
public int FullVersion
|
|
{
|
|
[Token(Token = "0x600B13B")]
|
|
[Address(RVA = "0x40F000", Offset = "0x40E000", VA = "0x18040F000")]
|
|
get
|
|
{
|
|
return this.version;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001C11 RID: 7185
|
|
// (get) Token: 0x0600B13C RID: 45372 RVA: 0x00265238 File Offset: 0x00263438
|
|
[Token(Token = "0x17001C11")]
|
|
public int MajorVersion
|
|
{
|
|
[Token(Token = "0x600B13C")]
|
|
[Address(RVA = "0x495B50", Offset = "0x494B50", VA = "0x180495B50")]
|
|
get
|
|
{
|
|
return this.version;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001C12 RID: 7186
|
|
// (get) Token: 0x0600B13D RID: 45373 RVA: 0x0026524C File Offset: 0x0026344C
|
|
[Token(Token = "0x17001C12")]
|
|
public int MinorVersion
|
|
{
|
|
[Token(Token = "0x600B13D")]
|
|
[Address(RVA = "0x4944B0", Offset = "0x4934B0", VA = "0x1804944B0")]
|
|
get
|
|
{
|
|
return this.version;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001C13 RID: 7187
|
|
// (get) Token: 0x0600B13E RID: 45374 RVA: 0x00265260 File Offset: 0x00263460
|
|
[Token(Token = "0x17001C13")]
|
|
public bool IsDtls
|
|
{
|
|
[Token(Token = "0x600B13E")]
|
|
[Address(RVA = "0x495AB0", Offset = "0x494AB0", VA = "0x180495AB0")]
|
|
get
|
|
{
|
|
return this.version == 65024;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001C14 RID: 7188
|
|
// (get) Token: 0x0600B13F RID: 45375 RVA: 0x0026527C File Offset: 0x0026347C
|
|
[Token(Token = "0x17001C14")]
|
|
public bool IsSsl
|
|
{
|
|
[Token(Token = "0x600B13F")]
|
|
[Address(RVA = "0x495AD0", Offset = "0x494AD0", VA = "0x180495AD0")]
|
|
get
|
|
{
|
|
return this == "{il2cpp field on {'constant10' (constant value of type Cpp2IL.Core.Analysis.ResultModels.StaticFieldsPtr)}, offset 0x0}";
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001C15 RID: 7189
|
|
// (get) Token: 0x0600B140 RID: 45376 RVA: 0x00265294 File Offset: 0x00263494
|
|
[Token(Token = "0x17001C15")]
|
|
public bool IsTls
|
|
{
|
|
[Token(Token = "0x600B140")]
|
|
[Address(RVA = "0x495B30", Offset = "0x494B30", VA = "0x180495B30")]
|
|
get
|
|
{
|
|
return this.version == 768;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600B141 RID: 45377 RVA: 0x002652B0 File Offset: 0x002634B0
|
|
[Token(Token = "0x600B141")]
|
|
[Address(RVA = "0x495340", Offset = "0x494340", VA = "0x180495340")]
|
|
public ProtocolVersion GetEquivalentTLSVersion()
|
|
{
|
|
if (this.version == 65024)
|
|
{
|
|
return ProtocolVersion.TLSv12;
|
|
}
|
|
return this;
|
|
}
|
|
|
|
// Token: 0x0600B142 RID: 45378 RVA: 0x002652D8 File Offset: 0x002634D8
|
|
[Token(Token = "0x600B142")]
|
|
[Address(RVA = "0x495810", Offset = "0x494810", VA = "0x180495810")]
|
|
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: 0x0600B143 RID: 45379 RVA: 0x00265318 File Offset: 0x00263518
|
|
[Token(Token = "0x600B143")]
|
|
[Address(RVA = "0x495870", Offset = "0x494870", VA = "0x180495870")]
|
|
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: 0x0600B144 RID: 45380 RVA: 0x00265358 File Offset: 0x00263558
|
|
[Token(Token = "0x600B144")]
|
|
[Address(RVA = "0x4952A0", Offset = "0x4942A0", VA = "0x1804952A0", 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: 0x0600B145 RID: 45381 RVA: 0x00265384 File Offset: 0x00263584
|
|
[Token(Token = "0x600B145")]
|
|
[Address(RVA = "0x495280", Offset = "0x494280", VA = "0x180495280")]
|
|
public bool Equals(ProtocolVersion other)
|
|
{
|
|
if (other == 0)
|
|
{
|
|
}
|
|
int num = other.version;
|
|
return this.TLSv11 == num;
|
|
}
|
|
|
|
// Token: 0x0600B146 RID: 45382 RVA: 0x002653A8 File Offset: 0x002635A8
|
|
[Token(Token = "0x600B146")]
|
|
[Address(RVA = "0x40F000", Offset = "0x40E000", VA = "0x18040F000", Slot = "2")]
|
|
public override int GetHashCode()
|
|
{
|
|
return this.version;
|
|
}
|
|
|
|
// Token: 0x0600B147 RID: 45383 RVA: 0x002653BC File Offset: 0x002635BC
|
|
[Token(Token = "0x600B147")]
|
|
[Address(RVA = "0x495540", Offset = "0x494540", VA = "0x180495540")]
|
|
public static ProtocolVersion Get(int major, int minor)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600B147)
|
|
|
|
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: 0x0600B148 RID: 45384 RVA: 0x0026542C File Offset: 0x0026362C
|
|
[Token(Token = "0x600B148")]
|
|
[Address(RVA = "0x4157B0", Offset = "0x4147B0", VA = "0x1804157B0", Slot = "3")]
|
|
public override string ToString()
|
|
{
|
|
return this.name;
|
|
}
|
|
|
|
// Token: 0x0600B149 RID: 45385 RVA: 0x00265440 File Offset: 0x00263640
|
|
[Token(Token = "0x600B149")]
|
|
[Address(RVA = "0x495410", Offset = "0x494410", VA = "0x180495410")]
|
|
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: 0x0600B14A RID: 45386 RVA: 0x002654A0 File Offset: 0x002636A0
|
|
// Note: this type is marked as 'beforefieldinit'.
|
|
[Token(Token = "0x600B14A")]
|
|
[Address(RVA = "0x4958D0", Offset = "0x4948D0", VA = "0x1804958D0")]
|
|
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: 0x04007128 RID: 28968
|
|
[Token(Token = "0x4007128")]
|
|
public static readonly ProtocolVersion SSLv3;
|
|
|
|
// Token: 0x04007129 RID: 28969
|
|
[Token(Token = "0x4007129")]
|
|
public static readonly ProtocolVersion TLSv10;
|
|
|
|
// Token: 0x0400712A RID: 28970
|
|
[Token(Token = "0x400712A")]
|
|
public static readonly ProtocolVersion TLSv11;
|
|
|
|
// Token: 0x0400712B RID: 28971
|
|
[Token(Token = "0x400712B")]
|
|
public static readonly ProtocolVersion TLSv12;
|
|
|
|
// Token: 0x0400712C RID: 28972
|
|
[Token(Token = "0x400712C")]
|
|
public static readonly ProtocolVersion DTLSv10;
|
|
|
|
// Token: 0x0400712D RID: 28973
|
|
[Token(Token = "0x400712D")]
|
|
public static readonly ProtocolVersion DTLSv12;
|
|
|
|
// Token: 0x0400712E RID: 28974
|
|
[FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x400712E")]
|
|
private readonly int version;
|
|
|
|
// Token: 0x0400712F RID: 28975
|
|
[FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x400712F")]
|
|
private readonly string name;
|
|
}
|
|
}
|