461 lines
14 KiB
C#
461 lines
14 KiB
C#
using System;
|
|
using System.Collections;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms
|
|
{
|
|
// Token: 0x02001F1D RID: 7965
|
|
[Token(Token = "0x2001F1D")]
|
|
public class AuthenticatedData : Asn1Encodable
|
|
{
|
|
// Token: 0x0600C94E RID: 51534 RVA: 0x002E1BB4 File Offset: 0x002DFDB4
|
|
[Token(Token = "0x600C94E")]
|
|
[Address(RVA = "0x2AD3600", Offset = "0x2AD2400", VA = "0x182AD3600")]
|
|
public AuthenticatedData(OriginatorInfo originatorInfo, Asn1Set recipientInfos, AlgorithmIdentifier macAlgorithm, AlgorithmIdentifier digestAlgorithm, ContentInfo encapsulatedContent, Asn1Set authAttrs, Asn1OctetString mac, Asn1Set unauthAttrs)
|
|
{
|
|
DerInteger derInteger = new DerInteger(AuthenticatedData.CalculateVersion(originatorInfo));
|
|
this.encapsulatedContentInfo = 0;
|
|
this.mac = 0;
|
|
this.version = derInteger;
|
|
this.authAttrs = 0;
|
|
this.unauthAttrs = 0;
|
|
this.originatorInfo = originatorInfo;
|
|
this.macAlgorithm = macAlgorithm;
|
|
this.digestAlgorithm = 0;
|
|
this.recipientInfos = recipientInfos;
|
|
}
|
|
|
|
// Token: 0x0600C94F RID: 51535 RVA: 0x002E1C20 File Offset: 0x002DFE20
|
|
[Token(Token = "0x600C94F")]
|
|
[Address(RVA = "0x2AD31C0", Offset = "0x2AD1FC0", VA = "0x182AD31C0")]
|
|
private AuthenticatedData(Asn1Sequence seq)
|
|
{
|
|
for (;;)
|
|
{
|
|
base..ctor();
|
|
Asn1SequenceParser parser = seq.Parser;
|
|
if (parser == 0)
|
|
{
|
|
}
|
|
if (parser != 0)
|
|
{
|
|
this.version = parser;
|
|
Asn1SequenceParser parser2 = seq.Parser;
|
|
if (parser2 != 0 && parser2 != 0)
|
|
{
|
|
if (parser2 == 0)
|
|
{
|
|
continue;
|
|
}
|
|
Asn1Sequence asn1Sequence;
|
|
OriginatorInfo instance = OriginatorInfo.GetInstance(asn1Sequence);
|
|
this.originatorInfo = instance;
|
|
Asn1SequenceParser parser3 = seq.Parser;
|
|
}
|
|
Asn1Set asn1Set;
|
|
this.recipientInfos = asn1Set;
|
|
Asn1SequenceParser parser4 = seq.Parser;
|
|
AlgorithmIdentifier algorithmIdentifier;
|
|
this.macAlgorithm = algorithmIdentifier;
|
|
Asn1SequenceParser parser5 = seq.Parser;
|
|
if (parser5 != 0 && parser5 != 0)
|
|
{
|
|
if (parser5 == 0)
|
|
{
|
|
continue;
|
|
}
|
|
AlgorithmIdentifier algorithmIdentifier2;
|
|
this.digestAlgorithm = algorithmIdentifier2;
|
|
Asn1SequenceParser parser6 = seq.Parser;
|
|
}
|
|
ContentInfo contentInfo;
|
|
this.encapsulatedContentInfo = contentInfo;
|
|
Asn1SequenceParser parser7 = seq.Parser;
|
|
if (parser7 != 0 && parser7 != 0)
|
|
{
|
|
if (parser7 == 0)
|
|
{
|
|
continue;
|
|
}
|
|
Asn1Set asn1Set2;
|
|
this.authAttrs = asn1Set2;
|
|
Asn1SequenceParser parser8 = seq.Parser;
|
|
}
|
|
Asn1OctetString asn1OctetString;
|
|
this.mac = asn1OctetString;
|
|
Asn1Encodable asn1Encodable;
|
|
if (asn1Encodable <= 1)
|
|
{
|
|
return;
|
|
}
|
|
Asn1SequenceParser parser9 = seq.Parser;
|
|
if (parser9 == 0 || parser9 != 0)
|
|
{
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
Asn1Set asn1Set3;
|
|
this.unauthAttrs = asn1Set3;
|
|
}
|
|
|
|
// Token: 0x0600C950 RID: 51536 RVA: 0x002E1D30 File Offset: 0x002DFF30
|
|
[Token(Token = "0x600C950")]
|
|
[Address(RVA = "0x2AD2C40", Offset = "0x2AD1A40", VA = "0x182AD2C40")]
|
|
public static AuthenticatedData GetInstance(Asn1TaggedObject obj, bool isExplicit)
|
|
{
|
|
return AuthenticatedData.GetInstance(Asn1Sequence.GetInstance(obj, isExplicit));
|
|
}
|
|
|
|
// Token: 0x0600C951 RID: 51537 RVA: 0x002E1D4C File Offset: 0x002DFF4C
|
|
[Token(Token = "0x600C951")]
|
|
[Address(RVA = "0x2AD2A50", Offset = "0x2AD1850", VA = "0x182AD2A50")]
|
|
public static AuthenticatedData GetInstance(object obj)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600C951)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AuthenticatedData BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AuthenticatedData::GetInstance(System.Object)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_26:
|
|
stloc:string(var_6_2C, call:string(Platform::GetTypeName, ldloc:object(obj)))
|
|
stloc:ArgumentException(var_7_3F, newobj:ArgumentException(ArgumentException::.ctor, call:string(string::Concat, ldstr:string("Invalid AuthenticatedData: "), ldloc:string(var_6_2C))))
|
|
}
|
|
|
|
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: 0x17001FA3 RID: 8099
|
|
// (get) Token: 0x0600C952 RID: 51538 RVA: 0x002E1D9C File Offset: 0x002DFF9C
|
|
[Token(Token = "0x17001FA3")]
|
|
public DerInteger Version
|
|
{
|
|
[Token(Token = "0x600C952")]
|
|
[Address(RVA = "0x3F6E20", Offset = "0x3F5C20", VA = "0x1803F6E20")]
|
|
get
|
|
{
|
|
return this.version;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001FA4 RID: 8100
|
|
// (get) Token: 0x0600C953 RID: 51539 RVA: 0x002E1DB0 File Offset: 0x002DFFB0
|
|
[Token(Token = "0x17001FA4")]
|
|
public OriginatorInfo OriginatorInfo
|
|
{
|
|
[Token(Token = "0x600C953")]
|
|
[Address(RVA = "0x3F5F40", Offset = "0x3F4D40", VA = "0x1803F5F40")]
|
|
get
|
|
{
|
|
return this.originatorInfo;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001FA5 RID: 8101
|
|
// (get) Token: 0x0600C954 RID: 51540 RVA: 0x002E1DC4 File Offset: 0x002DFFC4
|
|
[Token(Token = "0x17001FA5")]
|
|
public Asn1Set RecipientInfos
|
|
{
|
|
[Token(Token = "0x600C954")]
|
|
[Address(RVA = "0x3F6400", Offset = "0x3F5200", VA = "0x1803F6400")]
|
|
get
|
|
{
|
|
return this.recipientInfos;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001FA6 RID: 8102
|
|
// (get) Token: 0x0600C955 RID: 51541 RVA: 0x002E1DD8 File Offset: 0x002DFFD8
|
|
[Token(Token = "0x17001FA6")]
|
|
public AlgorithmIdentifier MacAlgorithm
|
|
{
|
|
[Token(Token = "0x600C955")]
|
|
[Address(RVA = "0x3F63E0", Offset = "0x3F51E0", VA = "0x1803F63E0")]
|
|
get
|
|
{
|
|
return this.macAlgorithm;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001FA7 RID: 8103
|
|
// (get) Token: 0x0600C956 RID: 51542 RVA: 0x002E1DEC File Offset: 0x002DFFEC
|
|
[Token(Token = "0x17001FA7")]
|
|
public AlgorithmIdentifier DigestAlgorithm
|
|
{
|
|
[Token(Token = "0x600C956")]
|
|
[Address(RVA = "0x3FA180", Offset = "0x3F8F80", VA = "0x1803FA180")]
|
|
get
|
|
{
|
|
return this.digestAlgorithm;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001FA8 RID: 8104
|
|
// (get) Token: 0x0600C957 RID: 51543 RVA: 0x002E1E00 File Offset: 0x002E0000
|
|
[Token(Token = "0x17001FA8")]
|
|
public ContentInfo EncapsulatedContentInfo
|
|
{
|
|
[Token(Token = "0x600C957")]
|
|
[Address(RVA = "0x3F63D0", Offset = "0x3F51D0", VA = "0x1803F63D0")]
|
|
get
|
|
{
|
|
return this.encapsulatedContentInfo;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001FA9 RID: 8105
|
|
// (get) Token: 0x0600C958 RID: 51544 RVA: 0x002E1E14 File Offset: 0x002E0014
|
|
[Token(Token = "0x17001FA9")]
|
|
public Asn1Set AuthAttrs
|
|
{
|
|
[Token(Token = "0x600C958")]
|
|
[Address(RVA = "0x408890", Offset = "0x407690", VA = "0x180408890")]
|
|
get
|
|
{
|
|
return this.authAttrs;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001FAA RID: 8106
|
|
// (get) Token: 0x0600C959 RID: 51545 RVA: 0x002E1E28 File Offset: 0x002E0028
|
|
[Token(Token = "0x17001FAA")]
|
|
public Asn1OctetString Mac
|
|
{
|
|
[Token(Token = "0x600C959")]
|
|
[Address(RVA = "0x3FA170", Offset = "0x3F8F70", VA = "0x1803FA170")]
|
|
get
|
|
{
|
|
return this.mac;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001FAB RID: 8107
|
|
// (get) Token: 0x0600C95A RID: 51546 RVA: 0x002E1E3C File Offset: 0x002E003C
|
|
[Token(Token = "0x17001FAB")]
|
|
public Asn1Set UnauthAttrs
|
|
{
|
|
[Token(Token = "0x600C95A")]
|
|
[Address(RVA = "0x415290", Offset = "0x414090", VA = "0x180415290")]
|
|
get
|
|
{
|
|
return this.unauthAttrs;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600C95B RID: 51547 RVA: 0x002E1E50 File Offset: 0x002E0050
|
|
[Token(Token = "0x600C95B")]
|
|
[Address(RVA = "0x2AD2C60", Offset = "0x2AD1A60", VA = "0x182AD2C60", Slot = "5")]
|
|
public override Asn1Object ToAsn1Object()
|
|
{
|
|
Asn1Encodable[] array = new Asn1Encodable[1];
|
|
DerInteger derInteger = this.version;
|
|
if (derInteger != 0)
|
|
{
|
|
}
|
|
array[0] = derInteger;
|
|
Asn1EncodableVector asn1EncodableVector = new Asn1EncodableVector(array);
|
|
int num = 0;
|
|
if (this.originatorInfo != num)
|
|
{
|
|
Asn1Encodable[] array2 = new Asn1Encodable[0];
|
|
OriginatorInfo originatorInfo = this.originatorInfo;
|
|
int num2;
|
|
int num3;
|
|
DerTaggedObject derTaggedObject = new DerTaggedObject(num2 != 0, num3, originatorInfo);
|
|
num3 = 0;
|
|
num2 = 0;
|
|
if (derTaggedObject != 0)
|
|
{
|
|
}
|
|
array2[0] = derTaggedObject;
|
|
asn1EncodableVector.Add(array2);
|
|
}
|
|
Asn1Encodable[] array3 = new Asn1Encodable[2];
|
|
Asn1Set asn1Set = this.recipientInfos;
|
|
if (asn1Set != 0)
|
|
{
|
|
}
|
|
array3[0] = asn1Set;
|
|
AlgorithmIdentifier algorithmIdentifier = this.macAlgorithm;
|
|
if (algorithmIdentifier != 0)
|
|
{
|
|
}
|
|
array3[1] = algorithmIdentifier;
|
|
asn1EncodableVector.Add(array3);
|
|
if (this.digestAlgorithm != num)
|
|
{
|
|
Asn1Encodable[] array4 = new Asn1Encodable[1];
|
|
AlgorithmIdentifier algorithmIdentifier2 = this.digestAlgorithm;
|
|
int num4;
|
|
DerTaggedObject derTaggedObject2 = new DerTaggedObject(num4 != 0, 1, algorithmIdentifier2);
|
|
num4 = 0;
|
|
if (derTaggedObject2 != 0)
|
|
{
|
|
}
|
|
array4[0] = derTaggedObject2;
|
|
asn1EncodableVector.Add(array4);
|
|
}
|
|
Asn1Encodable[] array5 = new Asn1Encodable[1];
|
|
ContentInfo contentInfo = this.encapsulatedContentInfo;
|
|
if (contentInfo != 0)
|
|
{
|
|
}
|
|
array5[0] = contentInfo;
|
|
asn1EncodableVector.Add(array5);
|
|
if (this.authAttrs != num)
|
|
{
|
|
Asn1Encodable[] array6 = new Asn1Encodable[1];
|
|
Asn1Set asn1Set2 = this.authAttrs;
|
|
int num5;
|
|
DerTaggedObject derTaggedObject3 = new DerTaggedObject(num5 != 0, 2, asn1Set2);
|
|
num5 = 0;
|
|
if (derTaggedObject3 != 0)
|
|
{
|
|
}
|
|
array6[0] = derTaggedObject3;
|
|
asn1EncodableVector.Add(array6);
|
|
}
|
|
Asn1Encodable[] array7 = new Asn1Encodable[1];
|
|
Asn1OctetString asn1OctetString = this.mac;
|
|
if (asn1OctetString != 0)
|
|
{
|
|
}
|
|
array7[0] = asn1OctetString;
|
|
asn1EncodableVector.Add(array7);
|
|
if (this.unauthAttrs != num)
|
|
{
|
|
Asn1Encodable[] array8 = new Asn1Encodable[1];
|
|
Asn1Set asn1Set3 = this.unauthAttrs;
|
|
int num6;
|
|
DerTaggedObject derTaggedObject4 = new DerTaggedObject(num6 != 0, 3, asn1Set3);
|
|
num6 = 0;
|
|
if (derTaggedObject4 != 0)
|
|
{
|
|
}
|
|
array8[0] = derTaggedObject4;
|
|
asn1EncodableVector.Add(array8);
|
|
}
|
|
BerSequence berSequence = new BerSequence(asn1EncodableVector);
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0600C95C RID: 51548 RVA: 0x002E201C File Offset: 0x002E021C
|
|
[Token(Token = "0x600C95C")]
|
|
[Address(RVA = "0x2AD26F0", Offset = "0x2AD14F0", VA = "0x182AD26F0")]
|
|
public static int CalculateVersion(OriginatorInfo origInfo)
|
|
{
|
|
int num;
|
|
do
|
|
{
|
|
num = 0;
|
|
if (origInfo == 0)
|
|
{
|
|
return 0;
|
|
}
|
|
IEnumerator enumerator = origInfo.certs.GetEnumerator();
|
|
if (enumerator != 0)
|
|
{
|
|
while (enumerator == 0)
|
|
{
|
|
}
|
|
while (enumerator == 0)
|
|
{
|
|
}
|
|
int num2 = 0;
|
|
if (enumerator == 0)
|
|
{
|
|
goto IL_5D;
|
|
}
|
|
if (num2 != 2)
|
|
{
|
|
while (num2 != 3)
|
|
{
|
|
}
|
|
}
|
|
}
|
|
if (enumerator != 0)
|
|
{
|
|
}
|
|
if (num != 0)
|
|
{
|
|
goto IL_63;
|
|
}
|
|
if (num != -1)
|
|
{
|
|
}
|
|
IEnumerator enumerator2 = origInfo.crls.GetEnumerator();
|
|
if (enumerator2 != 0)
|
|
{
|
|
while (enumerator2 == 0)
|
|
{
|
|
}
|
|
}
|
|
if (num != 0)
|
|
{
|
|
}
|
|
}
|
|
while (num != 0);
|
|
return num;
|
|
IL_5D:
|
|
throw new NullReferenceException();
|
|
IL_63:
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0400805D RID: 32861
|
|
[FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x400805D")]
|
|
private DerInteger version;
|
|
|
|
// Token: 0x0400805E RID: 32862
|
|
[FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x400805E")]
|
|
private OriginatorInfo originatorInfo;
|
|
|
|
// Token: 0x0400805F RID: 32863
|
|
[FieldOffset(Offset = "0x20")]
|
|
[Token(Token = "0x400805F")]
|
|
private Asn1Set recipientInfos;
|
|
|
|
// Token: 0x04008060 RID: 32864
|
|
[FieldOffset(Offset = "0x28")]
|
|
[Token(Token = "0x4008060")]
|
|
private AlgorithmIdentifier macAlgorithm;
|
|
|
|
// Token: 0x04008061 RID: 32865
|
|
[FieldOffset(Offset = "0x30")]
|
|
[Token(Token = "0x4008061")]
|
|
private AlgorithmIdentifier digestAlgorithm;
|
|
|
|
// Token: 0x04008062 RID: 32866
|
|
[FieldOffset(Offset = "0x38")]
|
|
[Token(Token = "0x4008062")]
|
|
private ContentInfo encapsulatedContentInfo;
|
|
|
|
// Token: 0x04008063 RID: 32867
|
|
[FieldOffset(Offset = "0x40")]
|
|
[Token(Token = "0x4008063")]
|
|
private Asn1Set authAttrs;
|
|
|
|
// Token: 0x04008064 RID: 32868
|
|
[FieldOffset(Offset = "0x48")]
|
|
[Token(Token = "0x4008064")]
|
|
private Asn1OctetString mac;
|
|
|
|
// Token: 0x04008065 RID: 32869
|
|
[FieldOffset(Offset = "0x50")]
|
|
[Token(Token = "0x4008065")]
|
|
private Asn1Set unauthAttrs;
|
|
}
|
|
}
|