339 lines
14 KiB
C#
339 lines
14 KiB
C#
using System;
|
|
using System.Runtime.CompilerServices;
|
|
using System.Text;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1
|
|
{
|
|
// Token: 0x02001DA3 RID: 7587
|
|
[Token(Token = "0x2001DA3")]
|
|
public class DerBitString : DerStringBase
|
|
{
|
|
// Token: 0x0600BFF7 RID: 49143 RVA: 0x002BB4FC File Offset: 0x002B96FC
|
|
[Token(Token = "0x600BFF7")]
|
|
[Address(RVA = "0x1878070", Offset = "0x1876E70", VA = "0x181878070")]
|
|
public static DerBitString GetInstance(object obj)
|
|
{
|
|
if (obj != 0 && obj == 0)
|
|
{
|
|
if (obj == 0)
|
|
{
|
|
goto IL_1C;
|
|
}
|
|
if (obj == 0)
|
|
{
|
|
goto IL_35;
|
|
}
|
|
}
|
|
if (obj == 0 || obj != 0)
|
|
{
|
|
}
|
|
IL_1C:
|
|
string typeName = Platform.GetTypeName(obj);
|
|
ArgumentException ex = new ArgumentException("illegal object in GetInstance: " + typeName);
|
|
IL_35:
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0600BFF8 RID: 49144 RVA: 0x0000220F File Offset: 0x0000040F
|
|
[Token(Token = "0x600BFF8")]
|
|
[Address(RVA = "0x1878280", Offset = "0x1877080", VA = "0x181878280")]
|
|
public static DerBitString GetInstance(Asn1TaggedObject obj, bool isExplicit)
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x0600BFF9 RID: 49145 RVA: 0x002BB54C File Offset: 0x002B974C
|
|
[Token(Token = "0x600BFF9")]
|
|
[Address(RVA = "0x18786B0", Offset = "0x18774B0", VA = "0x1818786B0")]
|
|
public DerBitString(byte[] data, int padBits)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600BFF9)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.DerBitString::.ctor(System.Byte[],System.Int32)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_3C:
|
|
stloc:ArgumentException(var_2_4B, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("must be in the range 0 to 7"), ldstr:string("padBits")))
|
|
}
|
|
|
|
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: 0x0600BFFA RID: 49146 RVA: 0x002BB5A4 File Offset: 0x002B97A4
|
|
[Token(Token = "0x600BFFA")]
|
|
[Address(RVA = "0x18787E0", Offset = "0x18775E0", VA = "0x1818787E0")]
|
|
public DerBitString(byte[] data)
|
|
{
|
|
}
|
|
|
|
// Token: 0x0600BFFB RID: 49147 RVA: 0x002BB5B4 File Offset: 0x002B97B4
|
|
[Token(Token = "0x600BFFB")]
|
|
[Address(RVA = "0x1878830", Offset = "0x1877630", VA = "0x181878830")]
|
|
public DerBitString(int namedBits)
|
|
{
|
|
if (namedBits != 0)
|
|
{
|
|
int num = 0;
|
|
int num2 = BigInteger.BitLen(namedBits);
|
|
num2 += 7;
|
|
num2 += num;
|
|
byte[] array = new byte[num2];
|
|
int num3 = 0;
|
|
if (num2 - 1 > 0)
|
|
{
|
|
num3++;
|
|
}
|
|
int num4 = num2 - 1;
|
|
if (namedBits == 1)
|
|
{
|
|
num3++;
|
|
uint num5;
|
|
while (namedBits == (int)num5)
|
|
{
|
|
}
|
|
}
|
|
this.mData = array;
|
|
this.mPadBits = num3;
|
|
return;
|
|
}
|
|
byte[] array2 = new byte[0];
|
|
int num6 = 0;
|
|
this.mPadBits = num6;
|
|
this.mData = array2;
|
|
}
|
|
|
|
// Token: 0x0600BFFC RID: 49148 RVA: 0x002BB634 File Offset: 0x002B9834
|
|
[Token(Token = "0x600BFFC")]
|
|
[Address(RVA = "0x18787F0", Offset = "0x18775F0", VA = "0x1818787F0")]
|
|
public DerBitString(Asn1Encodable obj)
|
|
{
|
|
byte[] derEncoded = obj.GetDerEncoded();
|
|
}
|
|
|
|
// Token: 0x0600BFFD RID: 49149 RVA: 0x002BB650 File Offset: 0x002B9850
|
|
[Token(Token = "0x600BFFD")]
|
|
[Address(RVA = "0x1878410", Offset = "0x1877210", VA = "0x181878410", Slot = "11")]
|
|
public virtual byte[] GetOctets()
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600BFFD)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Byte[] BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.DerBitString::GetOctets()
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_15:
|
|
stloc:InvalidOperationException(var_0_1F, newobj:InvalidOperationException(InvalidOperationException::.ctor, ldstr:string("attempt to get non-octet aligned data from BIT STRING")))
|
|
}
|
|
|
|
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: 0x0600BFFE RID: 49150 RVA: 0x002BB67C File Offset: 0x002B987C
|
|
[Token(Token = "0x600BFFE")]
|
|
[Address(RVA = "0x1877FC0", Offset = "0x1876DC0", VA = "0x181877FC0", Slot = "12")]
|
|
public virtual byte[] GetBytes()
|
|
{
|
|
byte[] array = Arrays.Clone(this.mData);
|
|
int num = this.mPadBits;
|
|
if (num > 0)
|
|
{
|
|
int length = array.Length;
|
|
int num2 = length - 1;
|
|
}
|
|
return array;
|
|
}
|
|
|
|
// Token: 0x17001DAC RID: 7596
|
|
// (get) Token: 0x0600BFFF RID: 49151 RVA: 0x002BB6B4 File Offset: 0x002B98B4
|
|
[Token(Token = "0x17001DAC")]
|
|
public virtual int PadBits
|
|
{
|
|
[Token(Token = "0x600BFFF")]
|
|
[Address(RVA = "0x40B720", Offset = "0x40A520", VA = "0x18040B720", Slot = "13")]
|
|
get
|
|
{
|
|
return this.mPadBits;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001DAD RID: 7597
|
|
// (get) Token: 0x0600C000 RID: 49152 RVA: 0x002BB6C8 File Offset: 0x002B98C8
|
|
[Token(Token = "0x17001DAD")]
|
|
public virtual int IntValue
|
|
{
|
|
[Token(Token = "0x600C000")]
|
|
[Address(RVA = "0x1878990", Offset = "0x1877790", VA = "0x181878990", Slot = "14")]
|
|
get
|
|
{
|
|
byte[] array = this.mData;
|
|
int num = 0;
|
|
int length = array.Length;
|
|
int num2 = Math.Min(4, length);
|
|
if (num2 > 0)
|
|
{
|
|
byte[] array2 = this.mData;
|
|
num++;
|
|
num += 8;
|
|
}
|
|
if (this.mPadBits > 0)
|
|
{
|
|
byte[] array3 = this.mData;
|
|
if (num2 == array3.Length)
|
|
{
|
|
}
|
|
}
|
|
return num;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600C001 RID: 49153 RVA: 0x002BB724 File Offset: 0x002B9924
|
|
[Token(Token = "0x600C001")]
|
|
[Address(RVA = "0x1877BF0", Offset = "0x18769F0", VA = "0x181877BF0", Slot = "6")]
|
|
internal override void Encode(DerOutputStream derOut)
|
|
{
|
|
int num = this.mPadBits;
|
|
if (num > 0)
|
|
{
|
|
byte[] array = this.mData;
|
|
int length = array.Length;
|
|
int num2 = length - 1;
|
|
num2 = num;
|
|
if (num2 != length)
|
|
{
|
|
byte[] array2 = Arrays.Prepend(array, (byte)num);
|
|
int num3 = array2.Length - 1;
|
|
int length2 = array2.Length;
|
|
derOut.WriteLength(length2);
|
|
int num4 = derOut.ReadByte();
|
|
return;
|
|
}
|
|
}
|
|
int num5 = this.mData.Length;
|
|
num5++;
|
|
if (num5 != 0)
|
|
{
|
|
uint num6;
|
|
num6 += (uint)1;
|
|
while (num5 != 0)
|
|
{
|
|
}
|
|
}
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0600C002 RID: 49154 RVA: 0x002BB7B0 File Offset: 0x002B99B0
|
|
[Token(Token = "0x600C002")]
|
|
[Address(RVA = "0x1877B70", Offset = "0x1876970", VA = "0x181877B70", Slot = "8")]
|
|
protected override int Asn1GetHashCode()
|
|
{
|
|
int num = this.mPadBits;
|
|
return Arrays.GetHashCode(this.mData);
|
|
}
|
|
|
|
// Token: 0x0600C003 RID: 49155 RVA: 0x002BB7D0 File Offset: 0x002B99D0
|
|
[Token(Token = "0x600C003")]
|
|
[Address(RVA = "0x1877AA0", Offset = "0x18768A0", VA = "0x181877AA0", Slot = "7")]
|
|
protected override bool Asn1Equals(Asn1Object asn1Object)
|
|
{
|
|
if (asn1Object == 0)
|
|
{
|
|
return;
|
|
}
|
|
int num = 0;
|
|
if (asn1Object != 0 && this.mPadBits == num)
|
|
{
|
|
byte[] array = this.mData;
|
|
bool flag;
|
|
return flag;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600C004 RID: 49156 RVA: 0x002BB7FC File Offset: 0x002B99FC
|
|
[Token(Token = "0x600C004")]
|
|
[Address(RVA = "0x18784A0", Offset = "0x18772A0", VA = "0x1818784A0", Slot = "10")]
|
|
public override string GetString()
|
|
{
|
|
StringBuilder stringBuilder = new StringBuilder("#");
|
|
byte[] derEncoded = base.GetDerEncoded();
|
|
int num = 0;
|
|
int length = derEncoded.Length;
|
|
if (num != length)
|
|
{
|
|
byte b;
|
|
char c = DerBitString.table[(int)b];
|
|
StringBuilder stringBuilder2 = stringBuilder.Append(c);
|
|
char[] array = DerBitString.table;
|
|
char c2;
|
|
StringBuilder stringBuilder3 = stringBuilder.Append(c2);
|
|
num++;
|
|
}
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0600C005 RID: 49157 RVA: 0x002BB85C File Offset: 0x002B9A5C
|
|
[Token(Token = "0x600C005")]
|
|
[Address(RVA = "0x1877E40", Offset = "0x1876C40", VA = "0x181877E40")]
|
|
internal static DerBitString FromAsn1Octets(byte[] octets)
|
|
{
|
|
int length = octets.Length;
|
|
byte b = octets[0];
|
|
int length2 = octets.Length;
|
|
byte[] array = Arrays.CopyOfRange(octets, 1, length2);
|
|
if (array.Length != 0)
|
|
{
|
|
BerBitString berBitString = new BerBitString(array, (int)b);
|
|
}
|
|
DerBitString derBitString = new DerBitString(array, (int)b);
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0600C006 RID: 49158 RVA: 0x002BB8A8 File Offset: 0x002B9AA8
|
|
// Note: this type is marked as 'beforefieldinit'.
|
|
[Token(Token = "0x600C006")]
|
|
[Address(RVA = "0x1878650", Offset = "0x1877450", VA = "0x181878650")]
|
|
static DerBitString()
|
|
{
|
|
char[] array = new char[16];
|
|
RuntimeHelpers.InitializeArray(array, fieldof(<PrivateImplementationDetails>.59F5BD34B6C013DEACC784F69C67E95150033A84).FieldHandle);
|
|
DerBitString.table = array;
|
|
}
|
|
|
|
// Token: 0x040079B0 RID: 31152
|
|
[Token(Token = "0x40079B0")]
|
|
private static readonly char[] table;
|
|
|
|
// Token: 0x040079B1 RID: 31153
|
|
[FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x40079B1")]
|
|
protected readonly byte[] mData;
|
|
|
|
// Token: 0x040079B2 RID: 31154
|
|
[FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x40079B2")]
|
|
protected readonly int mPadBits;
|
|
}
|
|
}
|