477 lines
15 KiB
C#
477 lines
15 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Runtime.InteropServices;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms
|
|
{
|
|
// Token: 0x02001940 RID: 6464
|
|
[Token(Token = "0x2001940")]
|
|
[StructLayout(3)]
|
|
public class AuthenticatedData : Asn1Encodable
|
|
{
|
|
// Token: 0x0600AD74 RID: 44404 RVA: 0x002896E4 File Offset: 0x002878E4
|
|
[Token(Token = "0x600AD74")]
|
|
[Address(RVA = "0x28EC530", Offset = "0x28EAF30", VA = "0x1828EC530")]
|
|
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: 0x0600AD75 RID: 44405 RVA: 0x00289750 File Offset: 0x00287950
|
|
[Token(Token = "0x600AD75")]
|
|
[Address(RVA = "0x28EC0F0", Offset = "0x28EAAF0", VA = "0x1828EC0F0")]
|
|
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: 0x0600AD76 RID: 44406 RVA: 0x00289860 File Offset: 0x00287A60
|
|
[Token(Token = "0x600AD76")]
|
|
[Address(RVA = "0x28EBB70", Offset = "0x28EA570", VA = "0x1828EBB70")]
|
|
public static AuthenticatedData GetInstance(Asn1TaggedObject obj, bool isExplicit)
|
|
{
|
|
return AuthenticatedData.GetInstance(Asn1Sequence.GetInstance(obj, isExplicit));
|
|
}
|
|
|
|
// Token: 0x0600AD77 RID: 44407 RVA: 0x0028987C File Offset: 0x00287A7C
|
|
[Token(Token = "0x600AD77")]
|
|
[Address(RVA = "0x28EB980", Offset = "0x28EA380", VA = "0x1828EB980")]
|
|
public static AuthenticatedData GetInstance(object obj)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600AD77)
|
|
|
|
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: 0x17001BA2 RID: 7074
|
|
// (get) Token: 0x0600AD78 RID: 44408 RVA: 0x002898CC File Offset: 0x00287ACC
|
|
[Token(Token = "0x17001BA2")]
|
|
public DerInteger Version
|
|
{
|
|
[Token(Token = "0x600AD78")]
|
|
[Address(RVA = "0x3C39A0", Offset = "0x3C23A0", VA = "0x1803C39A0")]
|
|
get
|
|
{
|
|
return this.version;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001BA3 RID: 7075
|
|
// (get) Token: 0x0600AD79 RID: 44409 RVA: 0x002898E0 File Offset: 0x00287AE0
|
|
[Token(Token = "0x17001BA3")]
|
|
public OriginatorInfo OriginatorInfo
|
|
{
|
|
[Token(Token = "0x600AD79")]
|
|
[Address(RVA = "0x3C1240", Offset = "0x3BFC40", VA = "0x1803C1240")]
|
|
get
|
|
{
|
|
return this.originatorInfo;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001BA4 RID: 7076
|
|
// (get) Token: 0x0600AD7A RID: 44410 RVA: 0x002898F4 File Offset: 0x00287AF4
|
|
[Token(Token = "0x17001BA4")]
|
|
public Asn1Set RecipientInfos
|
|
{
|
|
[Token(Token = "0x600AD7A")]
|
|
[Address(RVA = "0x3C1220", Offset = "0x3BFC20", VA = "0x1803C1220")]
|
|
get
|
|
{
|
|
return this.recipientInfos;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001BA5 RID: 7077
|
|
// (get) Token: 0x0600AD7B RID: 44411 RVA: 0x00289908 File Offset: 0x00287B08
|
|
[Token(Token = "0x17001BA5")]
|
|
public AlgorithmIdentifier MacAlgorithm
|
|
{
|
|
[Token(Token = "0x600AD7B")]
|
|
[Address(RVA = "0x3C1230", Offset = "0x3BFC30", VA = "0x1803C1230")]
|
|
get
|
|
{
|
|
return this.macAlgorithm;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001BA6 RID: 7078
|
|
// (get) Token: 0x0600AD7C RID: 44412 RVA: 0x0028991C File Offset: 0x00287B1C
|
|
[Token(Token = "0x17001BA6")]
|
|
public AlgorithmIdentifier DigestAlgorithm
|
|
{
|
|
[Token(Token = "0x600AD7C")]
|
|
[Address(RVA = "0x3C1250", Offset = "0x3BFC50", VA = "0x1803C1250")]
|
|
get
|
|
{
|
|
return this.digestAlgorithm;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001BA7 RID: 7079
|
|
// (get) Token: 0x0600AD7D RID: 44413 RVA: 0x00289930 File Offset: 0x00287B30
|
|
[Token(Token = "0x17001BA7")]
|
|
public ContentInfo EncapsulatedContentInfo
|
|
{
|
|
[Token(Token = "0x600AD7D")]
|
|
[Address(RVA = "0x3EE8E0", Offset = "0x3ED2E0", VA = "0x1803EE8E0")]
|
|
get
|
|
{
|
|
return this.encapsulatedContentInfo;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001BA8 RID: 7080
|
|
// (get) Token: 0x0600AD7E RID: 44414 RVA: 0x00289944 File Offset: 0x00287B44
|
|
[Token(Token = "0x17001BA8")]
|
|
public Asn1Set AuthAttrs
|
|
{
|
|
[Token(Token = "0x600AD7E")]
|
|
[Address(RVA = "0x3D32F0", Offset = "0x3D1CF0", VA = "0x1803D32F0")]
|
|
get
|
|
{
|
|
return this.authAttrs;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001BA9 RID: 7081
|
|
// (get) Token: 0x0600AD7F RID: 44415 RVA: 0x00289958 File Offset: 0x00287B58
|
|
[Token(Token = "0x17001BA9")]
|
|
public Asn1OctetString Mac
|
|
{
|
|
[Token(Token = "0x600AD7F")]
|
|
[Address(RVA = "0x3EDEA0", Offset = "0x3EC8A0", VA = "0x1803EDEA0")]
|
|
get
|
|
{
|
|
return this.mac;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001BAA RID: 7082
|
|
// (get) Token: 0x0600AD80 RID: 44416 RVA: 0x0028996C File Offset: 0x00287B6C
|
|
[Token(Token = "0x17001BAA")]
|
|
public Asn1Set UnauthAttrs
|
|
{
|
|
[Token(Token = "0x600AD80")]
|
|
[Address(RVA = "0x462740", Offset = "0x461140", VA = "0x180462740")]
|
|
get
|
|
{
|
|
return this.unauthAttrs;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600AD81 RID: 44417 RVA: 0x00289980 File Offset: 0x00287B80
|
|
[Token(Token = "0x600AD81")]
|
|
[Address(RVA = "0x28EBB90", Offset = "0x28EA590", VA = "0x1828EBB90", 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: 0x0600AD82 RID: 44418 RVA: 0x00289B4C File Offset: 0x00287D4C
|
|
[Token(Token = "0x600AD82")]
|
|
[Address(RVA = "0x28EB5E0", Offset = "0x28E9FE0", VA = "0x1828EB5E0")]
|
|
public static int CalculateVersion(OriginatorInfo origInfo)
|
|
{
|
|
int num;
|
|
for (;;)
|
|
{
|
|
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_6C;
|
|
}
|
|
if (num2 != 2)
|
|
{
|
|
while (num2 != 3)
|
|
{
|
|
}
|
|
}
|
|
}
|
|
if (enumerator != 0)
|
|
{
|
|
}
|
|
if (num == -1)
|
|
{
|
|
goto IL_54;
|
|
}
|
|
IEnumerator enumerator2 = origInfo.crls.GetEnumerator();
|
|
if (enumerator2 != 0)
|
|
{
|
|
while (enumerator2 == 0)
|
|
{
|
|
}
|
|
num++;
|
|
goto IL_54;
|
|
}
|
|
IL_58:
|
|
num++;
|
|
if (num != 0)
|
|
{
|
|
}
|
|
if (num != -1)
|
|
{
|
|
}
|
|
if (num == 0)
|
|
{
|
|
break;
|
|
}
|
|
continue;
|
|
IL_54:
|
|
if (num == 0)
|
|
{
|
|
goto IL_58;
|
|
}
|
|
goto IL_78;
|
|
}
|
|
return num;
|
|
IL_6C:
|
|
throw new NullReferenceException();
|
|
IL_78:
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0400721A RID: 29210
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x400721A")]
|
|
private DerInteger version;
|
|
|
|
// Token: 0x0400721B RID: 29211
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x400721B")]
|
|
private OriginatorInfo originatorInfo;
|
|
|
|
// Token: 0x0400721C RID: 29212
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
|
|
[Token(Token = "0x400721C")]
|
|
private Asn1Set recipientInfos;
|
|
|
|
// Token: 0x0400721D RID: 29213
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
|
|
[Token(Token = "0x400721D")]
|
|
private AlgorithmIdentifier macAlgorithm;
|
|
|
|
// Token: 0x0400721E RID: 29214
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
|
|
[Token(Token = "0x400721E")]
|
|
private AlgorithmIdentifier digestAlgorithm;
|
|
|
|
// Token: 0x0400721F RID: 29215
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x38")]
|
|
[Token(Token = "0x400721F")]
|
|
private ContentInfo encapsulatedContentInfo;
|
|
|
|
// Token: 0x04007220 RID: 29216
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x40")]
|
|
[Token(Token = "0x4007220")]
|
|
private Asn1Set authAttrs;
|
|
|
|
// Token: 0x04007221 RID: 29217
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x48")]
|
|
[Token(Token = "0x4007221")]
|
|
private Asn1OctetString mac;
|
|
|
|
// Token: 0x04007222 RID: 29218
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x50")]
|
|
[Token(Token = "0x4007222")]
|
|
private Asn1Set unauthAttrs;
|
|
}
|
|
}
|