Files
27Aug2021-Cpp2IL-Dump/Assembly-CSharp/BestHTTP/SecureProtocol/Org/BouncyCastle/Cms/SignerInformation.cs
T
niko c12fbe3fc6 m
2026-04-12 16:51:38 +02:00

737 lines
35 KiB
C#

using System;
using System.Collections;
using System.IO;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using BestHTTP.SecureProtocol.Org.BouncyCastle.X509;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001E4C RID: 7756
[Token(Token = "0x2001E4C")]
public class SignerInformation
{
// Token: 0x0600C27A RID: 49786 RVA: 0x002BF8E8 File Offset: 0x002BDAE8
[Token(Token = "0x600C27A")]
[Address(RVA = "0x2938AB0", Offset = "0x2937AB0", VA = "0x182938AB0")]
internal SignerInformation(SignerInfo info, DerObjectIdentifier contentType, CmsProcessable content, IDigestCalculator digestCalculator)
{
this.info = info;
SignerID signerID = new SignerID();
this.sid = signerID;
this.contentType = contentType;
bool flag = contentType == 0;
this.isCounterSignature = flag;
SignerIdentifier signerIdentifier = info.sid;
if (!signerIdentifier.IsTagged)
{
IssuerAndSerialNumber instance = IssuerAndSerialNumber.GetInstance(signerIdentifier.ID);
SignerID signerID2 = this.sid;
X509Name name = instance.name;
signerID2.issuer = name;
SignerID signerID3 = this.sid;
BigInteger value = instance.serialNumber.Value;
signerID3.serialNumber = value;
}
Asn1OctetString instance2 = Asn1OctetString.GetInstance(signerIdentifier.ID);
SignerID signerID4 = this.sid;
byte[] encoded = instance2.GetEncoded();
signerID4.SubjectKeyIdentifier = encoded;
AlgorithmIdentifier digAlgorithm = info.digAlgorithm;
this.digestAlgorithm = digAlgorithm;
Asn1Set authenticatedAttributes = info.authenticatedAttributes;
this.signedAttributeSet = authenticatedAttributes;
Asn1Set unauthenticatedAttributes = info.unauthenticatedAttributes;
this.unsignedAttributeSet = unauthenticatedAttributes;
AlgorithmIdentifier digEncryptionAlgorithm = info.digEncryptionAlgorithm;
this.encryptionAlgorithm = digEncryptionAlgorithm;
Stream octetStream = info.encryptedDigest.GetOctetStream();
this.signature = octetStream;
this.content = content;
this.digestCalculator = octetStream;
}
// Token: 0x0600C27B RID: 49787 RVA: 0x002BFA44 File Offset: 0x002BDC44
[Token(Token = "0x600C27B")]
[Address(RVA = "0x29389F0", Offset = "0x29379F0", VA = "0x1829389F0")]
protected SignerInformation(SignerInformation baseInfo)
{
SignerInfo signerInfo = baseInfo.info;
this.info = signerInfo;
DerObjectIdentifier derObjectIdentifier = baseInfo.contentType;
this.contentType = derObjectIdentifier;
bool flag = baseInfo.isCounterSignature;
this.isCounterSignature = flag;
SignerID signerID = baseInfo.sid;
this.sid = signerID;
AlgorithmIdentifier digAlgorithm = signerInfo.digAlgorithm;
this.digestAlgorithm = digAlgorithm;
Asn1Set authenticatedAttributes = signerInfo.authenticatedAttributes;
this.signedAttributeSet = authenticatedAttributes;
Asn1Set unauthenticatedAttributes = signerInfo.unauthenticatedAttributes;
this.unsignedAttributeSet = unauthenticatedAttributes;
AlgorithmIdentifier digEncryptionAlgorithm = signerInfo.digEncryptionAlgorithm;
this.encryptionAlgorithm = digEncryptionAlgorithm;
Stream octetStream = signerInfo.encryptedDigest.GetOctetStream();
this.signature = octetStream;
CmsProcessable cmsProcessable = baseInfo.content;
this.content = cmsProcessable;
byte[] array = baseInfo.resultDigest;
this.resultDigest = array;
BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable attributeTable = baseInfo.signedAttributeTable;
this.signedAttributeTable = attributeTable;
BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable attributeTable2 = baseInfo.unsignedAttributeTable;
this.unsignedAttributeTable = attributeTable2;
}
// Token: 0x17001E24 RID: 7716
// (get) Token: 0x0600C27C RID: 49788 RVA: 0x002BFB2C File Offset: 0x002BDD2C
[Token(Token = "0x17001E24")]
public bool IsCounterSignature
{
[Token(Token = "0x600C27C")]
[Address(RVA = "0x82DDE0", Offset = "0x82CDE0", VA = "0x18082DDE0")]
get
{
return this.isCounterSignature;
}
}
// Token: 0x17001E25 RID: 7717
// (get) Token: 0x0600C27D RID: 49789 RVA: 0x002BFB40 File Offset: 0x002BDD40
[Token(Token = "0x17001E25")]
public DerObjectIdentifier ContentType
{
[Token(Token = "0x600C27D")]
[Address(RVA = "0x4936E0", Offset = "0x4926E0", VA = "0x1804936E0")]
get
{
return this.contentType;
}
}
// Token: 0x17001E26 RID: 7718
// (get) Token: 0x0600C27E RID: 49790 RVA: 0x002BFB54 File Offset: 0x002BDD54
[Token(Token = "0x17001E26")]
public SignerID SignerID
{
[Token(Token = "0x600C27E")]
[Address(RVA = "0x411530", Offset = "0x410530", VA = "0x180411530")]
get
{
return this.sid;
}
}
// Token: 0x17001E27 RID: 7719
// (get) Token: 0x0600C27F RID: 49791 RVA: 0x002BFB68 File Offset: 0x002BDD68
[Token(Token = "0x17001E27")]
public int Version
{
[Token(Token = "0x600C27F")]
[Address(RVA = "0x214CFC0", Offset = "0x214BFC0", VA = "0x18214CFC0")]
get
{
return this.info.version.Value.IntValue;
}
}
// Token: 0x17001E28 RID: 7720
// (get) Token: 0x0600C280 RID: 49792 RVA: 0x002BFB90 File Offset: 0x002BDD90
[Token(Token = "0x17001E28")]
public AlgorithmIdentifier DigestAlgorithmID
{
[Token(Token = "0x600C280")]
[Address(RVA = "0x4157C0", Offset = "0x4147C0", VA = "0x1804157C0")]
get
{
return this.digestAlgorithm;
}
}
// Token: 0x17001E29 RID: 7721
// (get) Token: 0x0600C281 RID: 49793 RVA: 0x002BFBA4 File Offset: 0x002BDDA4
[Token(Token = "0x17001E29")]
public string DigestAlgOid
{
[Token(Token = "0x600C281")]
[Address(RVA = "0x21429A0", Offset = "0x21419A0", VA = "0x1821429A0")]
get
{
Asn1Object asn1Object = this.digestAlgorithm.ToAsn1Object();
throw new NullReferenceException();
}
}
// Token: 0x17001E2A RID: 7722
// (get) Token: 0x0600C282 RID: 49794 RVA: 0x002BFBC4 File Offset: 0x002BDDC4
[Token(Token = "0x17001E2A")]
public Asn1Object DigestAlgParams
{
[Token(Token = "0x600C282")]
[Address(RVA = "0x2938CC0", Offset = "0x2937CC0", VA = "0x182938CC0")]
get
{
DerObjectIdentifier objectID = this.digestAlgorithm.ObjectID;
if (objectID == 0)
{
}
return objectID.ToAsn1Object();
}
}
// Token: 0x0600C283 RID: 49795 RVA: 0x002BFBF0 File Offset: 0x002BDDF0
[Token(Token = "0x600C283")]
[Address(RVA = "0x29376B0", Offset = "0x29366B0", VA = "0x1829376B0")]
public byte[] GetContentDigest()
{
/*
An exception occurred when decompiling this method (0600C283)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Byte[] BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.SignerInformation::GetContentDigest()
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_09:
stloc:InvalidOperationException(var_0_13, newobj:InvalidOperationException(InvalidOperationException::.ctor, ldstr:string("method can only be called after verify.")))
}
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: 0x17001E2B RID: 7723
// (get) Token: 0x0600C284 RID: 49796 RVA: 0x002BFC10 File Offset: 0x002BDE10
[Token(Token = "0x17001E2B")]
public AlgorithmIdentifier EncryptionAlgorithmID
{
[Token(Token = "0x600C284")]
[Address(RVA = "0x4157D0", Offset = "0x4147D0", VA = "0x1804157D0")]
get
{
return this.encryptionAlgorithm;
}
}
// Token: 0x17001E2C RID: 7724
// (get) Token: 0x0600C285 RID: 49797 RVA: 0x002BFC24 File Offset: 0x002BDE24
[Token(Token = "0x17001E2C")]
public string EncryptionAlgOid
{
[Token(Token = "0x600C285")]
[Address(RVA = "0x2938D10", Offset = "0x2937D10", VA = "0x182938D10")]
get
{
Asn1Object asn1Object = this.encryptionAlgorithm.ToAsn1Object();
throw new NullReferenceException();
}
}
// Token: 0x17001E2D RID: 7725
// (get) Token: 0x0600C286 RID: 49798 RVA: 0x002BFC44 File Offset: 0x002BDE44
[Token(Token = "0x17001E2D")]
public Asn1Object EncryptionAlgParams
{
[Token(Token = "0x600C286")]
[Address(RVA = "0x2938D50", Offset = "0x2937D50", VA = "0x182938D50")]
get
{
DerObjectIdentifier objectID = this.encryptionAlgorithm.ObjectID;
if (objectID == 0)
{
}
return objectID.ToAsn1Object();
}
}
// Token: 0x17001E2E RID: 7726
// (get) Token: 0x0600C287 RID: 49799 RVA: 0x002BFC70 File Offset: 0x002BDE70
[Token(Token = "0x17001E2E")]
public BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable SignedAttributes
{
[Token(Token = "0x600C287")]
[Address(RVA = "0x2938DA0", Offset = "0x2937DA0", VA = "0x182938DA0")]
get
{
Asn1Set asn1Set = this.signedAttributeSet;
if (asn1Set != 0 && this.signedAttributeTable == (ulong)0L)
{
BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable attributeTable = new BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable(asn1Set);
this.signedAttributeTable = attributeTable;
return attributeTable;
}
return this.signedAttributeTable;
}
}
// Token: 0x17001E2F RID: 7727
// (get) Token: 0x0600C288 RID: 49800 RVA: 0x002BFCAC File Offset: 0x002BDEAC
[Token(Token = "0x17001E2F")]
public BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable UnsignedAttributes
{
[Token(Token = "0x600C288")]
[Address(RVA = "0x2938E20", Offset = "0x2937E20", VA = "0x182938E20")]
get
{
Asn1Set asn1Set = this.unsignedAttributeSet;
if (asn1Set != 0 && this.unsignedAttributeTable == (ulong)0L)
{
BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable attributeTable = new BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable(asn1Set);
this.unsignedAttributeTable = attributeTable;
return attributeTable;
}
return this.unsignedAttributeTable;
}
}
// Token: 0x0600C289 RID: 49801 RVA: 0x002BFCE8 File Offset: 0x002BDEE8
[Token(Token = "0x600C289")]
[Address(RVA = "0x2937D00", Offset = "0x2936D00", VA = "0x182937D00")]
public byte[] GetSignature()
{
byte[] array = this.signature;
throw new NullReferenceException();
}
// Token: 0x0600C28A RID: 49802 RVA: 0x002BFD04 File Offset: 0x002BDF04
[Token(Token = "0x600C28A")]
[Address(RVA = "0x2937760", Offset = "0x2936760", VA = "0x182937760")]
public SignerInformationStore GetCounterSignatures()
{
IList list;
SignerInformation signerInformation;
do
{
BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable unsignedAttributes = this.UnsignedAttributes;
if (unsignedAttributes == 0)
{
goto IL_AB;
}
list = Platform.CreateArrayList();
DerObjectIdentifier counterSignature = CmsAttributes.CounterSignature;
IEnumerator enumerator = unsignedAttributes.GetAll(counterSignature).GetEnumerator();
if (enumerator != 0)
{
if (enumerator == 0 || enumerator == 0)
{
goto IL_E7;
}
CmsSignedHelper instance = CmsSignedHelper.Instance;
SignerInfo signerInfo;
Asn1Object asn1Object = signerInfo.digAlgorithm.ToAsn1Object();
CounterSignatureDigestCalculator counterSignatureDigestCalculator;
string text;
counterSignatureDigestCalculator.alg = text;
byte[] array;
counterSignatureDigestCalculator.data = array;
int num;
int num2;
signerInformation = new SignerInformation(signerInfo, num, num2, counterSignatureDigestCalculator);
num2 = 0;
num = 0;
if ((uint)(-1) != 0U)
{
}
if (signerInformation != 0)
{
goto IL_E1;
}
while ((ulong)((uint)(-1)) == (ulong)(-1L))
{
}
}
if ((uint)(-1) != 0U)
{
}
}
while (signerInformation != 0);
SignerInformationStore signerInformationStore = new SignerInformationStore(list);
IL_AB:
return new SignerInformationStore(Platform.CreateArrayList(0));
IL_E1:
throw new NullReferenceException();
IL_E7:
throw new NullReferenceException();
}
// Token: 0x0600C28B RID: 49803 RVA: 0x002BFE04 File Offset: 0x002BE004
[Token(Token = "0x600C28B")]
[Address(RVA = "0x2937CB0", Offset = "0x2936CB0", VA = "0x182937CB0")]
public byte[] GetEncodedSignedAttributes()
{
Asn1Set asn1Set = this.signedAttributeSet;
if (asn1Set == 0)
{
}
return asn1Set.GetEncoded("DER");
}
// Token: 0x0600C28C RID: 49804 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x600C28C")]
[Address(RVA = "0x29367C0", Offset = "0x29357C0", VA = "0x1829367C0")]
private bool DoVerify(AsymmetricKeyParameter key)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x0600C28D RID: 49805 RVA: 0x002BFE2C File Offset: 0x002BE02C
[Token(Token = "0x600C28D")]
[Address(RVA = "0x29380B0", Offset = "0x29370B0", VA = "0x1829380B0")]
private bool IsNull(Asn1Encodable o)
{
return (o != 0 && o != 0) || o == 0;
}
// Token: 0x0600C28E RID: 49806 RVA: 0x002BFE4C File Offset: 0x002BE04C
[Token(Token = "0x600C28E")]
[Address(RVA = "0x29366C0", Offset = "0x29356C0", VA = "0x1829366C0")]
private DigestInfo DerDecode(byte[] encoding)
{
/*
An exception occurred when decompiling this method (0600C28E)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509.DigestInfo BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.SignerInformation::DerDecode(System.Byte[])
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_36:
stloc:CmsException(var_3_40, newobj:CmsException(CmsException::.ctor, ldstr:string("malformed RSA signature")))
}
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: 0x0600C28F RID: 49807 RVA: 0x002BFE9C File Offset: 0x002BE09C
[Token(Token = "0x600C28F")]
[Address(RVA = "0x2938280", Offset = "0x2937280", VA = "0x182938280")]
private bool VerifyDigest(byte[] digest, AsymmetricKeyParameter key, byte[] signature)
{
CmsSignedHelper helper = SignerInformation.Helper;
Asn1Object asn1Object = this.encryptionAlgorithm.ToAsn1Object();
string text;
if (!text.Equals("RSA"))
{
if (!text.Equals("DSA"))
{
string text2;
CmsException ex = new CmsException(text2);
throw new NullReferenceException();
}
ISigner signer = SignerUtilities.GetSigner("NONEwithDSA");
int length = digest.Length;
}
IBufferedCipher bufferedCipher = CmsEnvelopedHelper.Instance.CreateAsymmetricCipher("RSA/ECB/PKCS1Padding");
int num = 0;
if (num < bufferedCipher)
{
num += num;
num++;
}
Asn1Object asn1Object2;
DigestInfo instance = DigestInfo.GetInstance(asn1Object2);
if (instance.GetEncoded().Length == instance)
{
Asn1Object asn1Object3 = instance.algID.ToAsn1Object();
if (this.digestAlgorithm.ToAsn1Object() != 0)
{
DerObjectIdentifier objectID = instance.algID.ObjectID;
if (objectID == 0 || objectID != 0 || objectID == 0)
{
byte[] digest2 = instance.digest;
bool flag = Arrays.ConstantTimeAreEqual(digest, digest2);
}
}
throw new NullReferenceException();
}
CmsException ex2 = new CmsException("malformed RSA signature");
throw new NullReferenceException();
}
// Token: 0x0600C290 RID: 49808 RVA: 0x002BFFFC File Offset: 0x002BE1FC
[Token(Token = "0x600C290")]
[Address(RVA = "0x29388E0", Offset = "0x29378E0", VA = "0x1829388E0")]
public bool Verify(AsymmetricKeyParameter pubKey)
{
/*
An exception occurred when decompiling this method (0600C290)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Boolean BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.SignerInformation::Verify(BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.AsymmetricKeyParameter)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_1E:
stloc:ArgumentException(var_1_2D, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("Expected public key"), ldstr:string("pubKey")))
}
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: 0x0600C291 RID: 49809 RVA: 0x002C0038 File Offset: 0x002BE238
[Token(Token = "0x600C291")]
[Address(RVA = "0x2938860", Offset = "0x2937860", VA = "0x182938860")]
public bool Verify(X509Certificate cert)
{
BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.Time signingTime = this.GetSigningTime();
if (signingTime != 0)
{
DateTime date = signingTime.Date;
}
bool flag;
return flag;
}
// Token: 0x0600C292 RID: 49810 RVA: 0x002C0060 File Offset: 0x002BE260
[Token(Token = "0x600C292")]
[Address(RVA = "0x4157B0", Offset = "0x4147B0", VA = "0x1804157B0")]
public SignerInfo ToSignerInfo()
{
return this.info;
}
// Token: 0x0600C293 RID: 49811 RVA: 0x002C0074 File Offset: 0x002BE274
[Token(Token = "0x600C293")]
[Address(RVA = "0x2937E60", Offset = "0x2936E60", VA = "0x182937E60")]
private Asn1Object GetSingleValuedSignedAttribute(DerObjectIdentifier attrOID, string printableName)
{
/*
An exception occurred when decompiling this method (0600C293)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Asn1Object BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.SignerInformation::GetSingleValuedSignedAttribute(BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.DerObjectIdentifier,System.String)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_4D:
stloc:CmsException(var_10_57, newobj:CmsException(CmsException::.ctor, ldloc:string(var_9)))
stloc:CmsException(var_12_60, newobj:CmsException(CmsException::.ctor, ldloc:string(var_11)))
}
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: 0x0600C294 RID: 49812 RVA: 0x002C00E4 File Offset: 0x002BE2E4
[Token(Token = "0x600C294")]
[Address(RVA = "0x2937D80", Offset = "0x2936D80", VA = "0x182937D80")]
private BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.Time GetSigningTime()
{
/*
An exception occurred when decompiling this method (0600C294)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.Time BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.SignerInformation::GetSigningTime()
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_1E:
stloc:CmsException(var_2_28, newobj:CmsException(CmsException::.ctor, ldstr:string("signing-time attribute value not a valid 'Time' structure")))
}
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: 0x0600C295 RID: 49813 RVA: 0x002C011C File Offset: 0x002BE31C
[Token(Token = "0x600C295")]
[Address(RVA = "0x2938130", Offset = "0x2937130", VA = "0x182938130")]
public static SignerInformation ReplaceUnsignedAttributes(SignerInformation signerInformation, BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable unsignedAttributes)
{
SignerInfo signerInfo = signerInformation.info;
int num = 0;
if (unsignedAttributes != 0)
{
DerSet derSet = new DerSet(unsignedAttributes.ToAsn1EncodableVector());
}
Asn1OctetString encryptedDigest = signerInfo.encryptedDigest;
AlgorithmIdentifier digAlgorithm = signerInfo.digAlgorithm;
Asn1Set authenticatedAttributes = signerInfo.authenticatedAttributes;
AlgorithmIdentifier digEncryptionAlgorithm = signerInfo.digEncryptionAlgorithm;
SignerInfo signerInfo2 = new SignerInfo(signerInfo.sid, digAlgorithm, authenticatedAttributes, digEncryptionAlgorithm, encryptedDigest, num);
DerObjectIdentifier derObjectIdentifier = signerInformation.contentType;
CmsProcessable cmsProcessable = signerInformation.content;
int num2;
SignerInformation signerInformation2 = new SignerInformation(signerInfo2, derObjectIdentifier, cmsProcessable, num2);
num2 = 0;
throw new NullReferenceException();
}
// Token: 0x0600C296 RID: 49814 RVA: 0x002C01A0 File Offset: 0x002BE3A0
[Token(Token = "0x600C296")]
[Address(RVA = "0x2936190", Offset = "0x2935190", VA = "0x182936190")]
public static SignerInformation AddCounterSigners(SignerInformation signerInformation, SignerInformationStore counterSigners)
{
int num;
Asn1EncodableVector asn1EncodableVector;
Asn1EncodableVector asn1EncodableVector2;
do
{
num = 0;
BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable unsignedAttributes = signerInformation.UnsignedAttributes;
if (unsignedAttributes == 0)
{
}
asn1EncodableVector = unsignedAttributes.ToAsn1EncodableVector();
IList list = Platform.CreateArrayList(counterSigners.all);
Asn1Encodable[] array;
if (list != 0)
{
if (num < list)
{
num += num;
num++;
}
if (list == 0)
{
}
if (list == 0)
{
goto IL_D5;
}
array = new Asn1Encodable[1];
if (list != 0)
{
}
array[0] = list;
asn1EncodableVector2.Add(array);
}
if (array != 0)
{
}
}
while (num != 0);
Asn1Encodable[] array2 = new Asn1Encodable[1];
DerObjectIdentifier counterSignature = CmsAttributes.CounterSignature;
DerSet derSet = new DerSet(asn1EncodableVector2);
BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.Attribute attribute = new BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.Attribute(counterSignature, derSet);
if (attribute != 0)
{
}
array2[0] = attribute;
asn1EncodableVector.Add(array2);
DerSet derSet2 = new DerSet(asn1EncodableVector);
throw new NullReferenceException();
IL_D5:
throw new NullReferenceException();
}
// Token: 0x04007AFA RID: 31482
[Token(Token = "0x4007AFA")]
private static readonly CmsSignedHelper Helper = CmsSignedHelper.Instance;
// Token: 0x04007AFB RID: 31483
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007AFB")]
private SignerID sid;
// Token: 0x04007AFC RID: 31484
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007AFC")]
private SignerInfo info;
// Token: 0x04007AFD RID: 31485
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007AFD")]
private AlgorithmIdentifier digestAlgorithm;
// Token: 0x04007AFE RID: 31486
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x4007AFE")]
private AlgorithmIdentifier encryptionAlgorithm;
// Token: 0x04007AFF RID: 31487
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x4007AFF")]
private readonly Asn1Set signedAttributeSet;
// Token: 0x04007B00 RID: 31488
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x4007B00")]
private readonly Asn1Set unsignedAttributeSet;
// Token: 0x04007B01 RID: 31489
[FieldOffset(Offset = "0x40")]
[Token(Token = "0x4007B01")]
private CmsProcessable content;
// Token: 0x04007B02 RID: 31490
[FieldOffset(Offset = "0x48")]
[Token(Token = "0x4007B02")]
private byte[] signature;
// Token: 0x04007B03 RID: 31491
[FieldOffset(Offset = "0x50")]
[Token(Token = "0x4007B03")]
private DerObjectIdentifier contentType;
// Token: 0x04007B04 RID: 31492
[FieldOffset(Offset = "0x58")]
[Token(Token = "0x4007B04")]
private IDigestCalculator digestCalculator;
// Token: 0x04007B05 RID: 31493
[FieldOffset(Offset = "0x60")]
[Token(Token = "0x4007B05")]
private byte[] resultDigest;
// Token: 0x04007B06 RID: 31494
[FieldOffset(Offset = "0x68")]
[Token(Token = "0x4007B06")]
private BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable signedAttributeTable;
// Token: 0x04007B07 RID: 31495
[FieldOffset(Offset = "0x70")]
[Token(Token = "0x4007B07")]
private BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable unsignedAttributeTable;
// Token: 0x04007B08 RID: 31496
[FieldOffset(Offset = "0x78")]
[Token(Token = "0x4007B08")]
private readonly bool isCounterSignature;
}
}