241 lines
9.6 KiB
C#
241 lines
9.6 KiB
C#
using System;
|
|
using System.IO;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1
|
|
{
|
|
// Token: 0x02001E81 RID: 7809
|
|
[Token(Token = "0x2001E81")]
|
|
public class DerApplicationSpecific : Asn1Object
|
|
{
|
|
// Token: 0x0600C3AF RID: 50095 RVA: 0x002C3818 File Offset: 0x002C1A18
|
|
[Token(Token = "0x600C3AF")]
|
|
[Address(RVA = "0x23A5EF0", Offset = "0x23A4EF0", VA = "0x1823A5EF0")]
|
|
internal DerApplicationSpecific(bool isConstructed, int tag, byte[] octets)
|
|
{
|
|
this.isConstructed = isConstructed;
|
|
this.tag = tag;
|
|
this.octets = octets;
|
|
}
|
|
|
|
// Token: 0x0600C3B0 RID: 50096 RVA: 0x002C3840 File Offset: 0x002C1A40
|
|
[Token(Token = "0x600C3B0")]
|
|
[Address(RVA = "0x23A5EB0", Offset = "0x23A4EB0", VA = "0x1823A5EB0")]
|
|
public DerApplicationSpecific(int tag, byte[] octets)
|
|
{
|
|
this.tag = tag;
|
|
this.octets = octets;
|
|
this.isConstructed = false;
|
|
}
|
|
|
|
// Token: 0x0600C3B1 RID: 50097 RVA: 0x002C3868 File Offset: 0x002C1A68
|
|
[Token(Token = "0x600C3B1")]
|
|
[Address(RVA = "0x23A5E10", Offset = "0x23A4E10", VA = "0x1823A5E10")]
|
|
public DerApplicationSpecific(int tag, Asn1Encodable obj)
|
|
{
|
|
Asn1Object asn1Object = obj.ToAsn1Object();
|
|
byte[] derEncoded = asn1Object.GetDerEncoded();
|
|
bool flag = Asn1TaggedObject.IsConstructed(true, asn1Object);
|
|
this.tag = tag;
|
|
this.octets = derEncoded;
|
|
this.isConstructed = flag;
|
|
}
|
|
|
|
// Token: 0x0600C3B2 RID: 50098 RVA: 0x002C38AC File Offset: 0x002C1AAC
|
|
[Token(Token = "0x600C3B2")]
|
|
[Address(RVA = "0x23A5AF0", Offset = "0x23A4AF0", VA = "0x1823A5AF0")]
|
|
public DerApplicationSpecific(bool isExplicit, int tag, Asn1Encodable obj)
|
|
{
|
|
Asn1Object asn1Object = obj.ToAsn1Object();
|
|
byte[] derEncoded = asn1Object.GetDerEncoded();
|
|
bool flag = Asn1TaggedObject.IsConstructed(isExplicit, asn1Object);
|
|
this.isConstructed = flag;
|
|
this.tag = tag;
|
|
if (!isExplicit)
|
|
{
|
|
int num = derEncoded.Length;
|
|
byte b = derEncoded[0];
|
|
uint num2;
|
|
num -= (int)num2;
|
|
byte[] array = new byte[num];
|
|
int length = array.Length;
|
|
int num3 = 0;
|
|
Array.Copy(derEncoded, (int)num2, array, num3, length);
|
|
this.octets = array;
|
|
return;
|
|
}
|
|
this.octets = derEncoded;
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0600C3B3 RID: 50099 RVA: 0x002C3948 File Offset: 0x002C1B48
|
|
[Token(Token = "0x600C3B3")]
|
|
[Address(RVA = "0x23A5CA0", Offset = "0x23A4CA0", VA = "0x1823A5CA0")]
|
|
public DerApplicationSpecific(int tagNo, Asn1EncodableVector vec)
|
|
{
|
|
this.tag = tagNo;
|
|
this.isConstructed = true;
|
|
MemoryStream memoryStream = new MemoryStream();
|
|
int num = 0;
|
|
int count = vec.Count;
|
|
if (num != count)
|
|
{
|
|
byte[] derEncoded = vec[num].GetDerEncoded();
|
|
int num2 = memoryStream.ReadByte();
|
|
num++;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600C3B4 RID: 50100 RVA: 0x002C39C0 File Offset: 0x002C1BC0
|
|
[Token(Token = "0x600C3B4")]
|
|
[Address(RVA = "0x23A5670", Offset = "0x23A4670", VA = "0x1823A5670")]
|
|
private int GetLengthOfHeader(byte[] data)
|
|
{
|
|
byte b = data[0];
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0600C3B5 RID: 50101 RVA: 0x002C39EC File Offset: 0x002C1BEC
|
|
[Token(Token = "0x600C3B5")]
|
|
[Address(RVA = "0x4944B0", Offset = "0x4934B0", VA = "0x1804944B0")]
|
|
public bool IsConstructed()
|
|
{
|
|
return this.isConstructed;
|
|
}
|
|
|
|
// Token: 0x0600C3B6 RID: 50102 RVA: 0x002C3A00 File Offset: 0x002C1C00
|
|
[Token(Token = "0x600C3B6")]
|
|
[Address(RVA = "0x4157B0", Offset = "0x4147B0", VA = "0x1804157B0")]
|
|
public byte[] GetContents()
|
|
{
|
|
return this.octets;
|
|
}
|
|
|
|
// Token: 0x17001E48 RID: 7752
|
|
// (get) Token: 0x0600C3B7 RID: 50103 RVA: 0x002C3A14 File Offset: 0x002C1C14
|
|
[Token(Token = "0x17001E48")]
|
|
public int ApplicationTag
|
|
{
|
|
[Token(Token = "0x600C3B7")]
|
|
[Address(RVA = "0x4936D0", Offset = "0x4926D0", VA = "0x1804936D0")]
|
|
get
|
|
{
|
|
return this.tag;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600C3B8 RID: 50104 RVA: 0x002C3A28 File Offset: 0x002C1C28
|
|
[Token(Token = "0x600C3B8")]
|
|
[Address(RVA = "0x23A5750", Offset = "0x23A4750", VA = "0x1823A5750")]
|
|
public Asn1Object GetObject()
|
|
{
|
|
return Asn1Object.FromByteArray(this.octets);
|
|
}
|
|
|
|
// Token: 0x0600C3B9 RID: 50105 RVA: 0x002C3A40 File Offset: 0x002C1C40
|
|
[Token(Token = "0x600C3B9")]
|
|
[Address(RVA = "0x23A5760", Offset = "0x23A4760", VA = "0x1823A5760")]
|
|
public Asn1Object GetObject(int derTagNo)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600C3B9)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Asn1Object BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.DerApplicationSpecific::GetObject(System.Int32)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_61:
|
|
stloc:IOException(var_9_6B, newobj:IOException(IOException::.ctor, ldstr:string("unsupported tag number")))
|
|
}
|
|
|
|
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: 0x0600C3BA RID: 50106 RVA: 0x002C3ABC File Offset: 0x002C1CBC
|
|
[Token(Token = "0x600C3BA")]
|
|
[Address(RVA = "0x23A55F0", Offset = "0x23A45F0", VA = "0x1823A55F0", Slot = "6")]
|
|
internal override void Encode(DerOutputStream derOut)
|
|
{
|
|
byte[] array = this.octets;
|
|
int num = this.tag;
|
|
derOut.WriteTag(64, num);
|
|
int length = array.Length;
|
|
derOut.WriteLength(length);
|
|
int num2 = derOut.ReadByte();
|
|
}
|
|
|
|
// Token: 0x0600C3BB RID: 50107 RVA: 0x002C3AFC File Offset: 0x002C1CFC
|
|
[Token(Token = "0x600C3BB")]
|
|
[Address(RVA = "0x23A5480", Offset = "0x23A4480", VA = "0x1823A5480", Slot = "7")]
|
|
protected override bool Asn1Equals(Asn1Object asn1Object)
|
|
{
|
|
if (asn1Object == 0)
|
|
{
|
|
return;
|
|
}
|
|
int num = 0;
|
|
if (asn1Object != 0 && (this.isConstructed ? 1 : 0) == num && this.tag == num)
|
|
{
|
|
byte[] array = this.octets;
|
|
bool flag;
|
|
return flag;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600C3BC RID: 50108 RVA: 0x002C3B30 File Offset: 0x002C1D30
|
|
[Token(Token = "0x600C3BC")]
|
|
[Address(RVA = "0x23A5550", Offset = "0x23A4550", VA = "0x1823A5550", Slot = "8")]
|
|
protected override int Asn1GetHashCode()
|
|
{
|
|
bool flag = this.isConstructed;
|
|
int num = this.tag;
|
|
return Arrays.GetHashCode(this.octets);
|
|
}
|
|
|
|
// Token: 0x0600C3BD RID: 50109 RVA: 0x002C3B58 File Offset: 0x002C1D58
|
|
[Token(Token = "0x600C3BD")]
|
|
[Address(RVA = "0x23A5980", Offset = "0x23A4980", VA = "0x1823A5980")]
|
|
private byte[] ReplaceTagNumber(int newTag, byte[] input)
|
|
{
|
|
int num = input.Length;
|
|
byte b = input[0];
|
|
byte b2 = input[0];
|
|
uint num2;
|
|
num2 += (uint)1;
|
|
uint num3;
|
|
num -= (int)num3;
|
|
byte[] array = new byte[num + 1];
|
|
array[0] = (byte)newTag;
|
|
uint num4;
|
|
Array.Copy(input, (int)num3, array, (int)num4, num);
|
|
return array;
|
|
}
|
|
|
|
// Token: 0x04007B65 RID: 31589
|
|
[FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x4007B65")]
|
|
private readonly bool isConstructed;
|
|
|
|
// Token: 0x04007B66 RID: 31590
|
|
[FieldOffset(Offset = "0x14")]
|
|
[Token(Token = "0x4007B66")]
|
|
private readonly int tag;
|
|
|
|
// Token: 0x04007B67 RID: 31591
|
|
[FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x4007B67")]
|
|
private readonly byte[] octets;
|
|
}
|
|
}
|