Files
Aug2021-Cpp2IL-Dump/Assembly-CSharp/BestHTTP/SecureProtocol/Org/BouncyCastle/Cms/SignerInformation.cs
T
2026-04-10 22:50:51 +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: 0x02001D6C RID: 7532
[Token(Token = "0x2001D6C")]
public class SignerInformation
{
// Token: 0x0600BEAC RID: 48812 RVA: 0x002B6FF0 File Offset: 0x002B51F0
[Token(Token = "0x600BEAC")]
[Address(RVA = "0x2017FB0", Offset = "0x2016DB0", VA = "0x182017FB0")]
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: 0x0600BEAD RID: 48813 RVA: 0x002B714C File Offset: 0x002B534C
[Token(Token = "0x600BEAD")]
[Address(RVA = "0x2017EF0", Offset = "0x2016CF0", VA = "0x182017EF0")]
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: 0x17001D87 RID: 7559
// (get) Token: 0x0600BEAE RID: 48814 RVA: 0x002B7234 File Offset: 0x002B5434
[Token(Token = "0x17001D87")]
public bool IsCounterSignature
{
[Token(Token = "0x600BEAE")]
[Address(RVA = "0x7C9360", Offset = "0x7C8160", VA = "0x1807C9360")]
get
{
return this.isCounterSignature;
}
}
// Token: 0x17001D88 RID: 7560
// (get) Token: 0x0600BEAF RID: 48815 RVA: 0x002B7248 File Offset: 0x002B5448
[Token(Token = "0x17001D88")]
public DerObjectIdentifier ContentType
{
[Token(Token = "0x600BEAF")]
[Address(RVA = "0x415290", Offset = "0x414090", VA = "0x180415290")]
get
{
return this.contentType;
}
}
// Token: 0x17001D89 RID: 7561
// (get) Token: 0x0600BEB0 RID: 48816 RVA: 0x002B725C File Offset: 0x002B545C
[Token(Token = "0x17001D89")]
public SignerID SignerID
{
[Token(Token = "0x600BEB0")]
[Address(RVA = "0x3F6E20", Offset = "0x3F5C20", VA = "0x1803F6E20")]
get
{
return this.sid;
}
}
// Token: 0x17001D8A RID: 7562
// (get) Token: 0x0600BEB1 RID: 48817 RVA: 0x002B7270 File Offset: 0x002B5470
[Token(Token = "0x17001D8A")]
public int Version
{
[Token(Token = "0x600BEB1")]
[Address(RVA = "0x166DBE0", Offset = "0x166C9E0", VA = "0x18166DBE0")]
get
{
return this.info.version.Value.IntValue;
}
}
// Token: 0x17001D8B RID: 7563
// (get) Token: 0x0600BEB2 RID: 48818 RVA: 0x002B7298 File Offset: 0x002B5498
[Token(Token = "0x17001D8B")]
public AlgorithmIdentifier DigestAlgorithmID
{
[Token(Token = "0x600BEB2")]
[Address(RVA = "0x3F6400", Offset = "0x3F5200", VA = "0x1803F6400")]
get
{
return this.digestAlgorithm;
}
}
// Token: 0x17001D8C RID: 7564
// (get) Token: 0x0600BEB3 RID: 48819 RVA: 0x002B72AC File Offset: 0x002B54AC
[Token(Token = "0x17001D8C")]
public string DigestAlgOid
{
[Token(Token = "0x600BEB3")]
[Address(RVA = "0x1661330", Offset = "0x1660130", VA = "0x181661330")]
get
{
Asn1Object asn1Object = this.digestAlgorithm.ToAsn1Object();
throw new NullReferenceException();
}
}
// Token: 0x17001D8D RID: 7565
// (get) Token: 0x0600BEB4 RID: 48820 RVA: 0x002B72CC File Offset: 0x002B54CC
[Token(Token = "0x17001D8D")]
public Asn1Object DigestAlgParams
{
[Token(Token = "0x600BEB4")]
[Address(RVA = "0x20181C0", Offset = "0x2016FC0", VA = "0x1820181C0")]
get
{
DerObjectIdentifier objectID = this.digestAlgorithm.ObjectID;
if (objectID == 0)
{
}
return objectID.ToAsn1Object();
}
}
// Token: 0x0600BEB5 RID: 48821 RVA: 0x002B72F8 File Offset: 0x002B54F8
[Token(Token = "0x600BEB5")]
[Address(RVA = "0x2016BB0", Offset = "0x20159B0", VA = "0x182016BB0")]
public byte[] GetContentDigest()
{
/*
An exception occurred when decompiling this method (0600BEB5)
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: 0x17001D8E RID: 7566
// (get) Token: 0x0600BEB6 RID: 48822 RVA: 0x002B7318 File Offset: 0x002B5518
[Token(Token = "0x17001D8E")]
public AlgorithmIdentifier EncryptionAlgorithmID
{
[Token(Token = "0x600BEB6")]
[Address(RVA = "0x3F63E0", Offset = "0x3F51E0", VA = "0x1803F63E0")]
get
{
return this.encryptionAlgorithm;
}
}
// Token: 0x17001D8F RID: 7567
// (get) Token: 0x0600BEB7 RID: 48823 RVA: 0x002B732C File Offset: 0x002B552C
[Token(Token = "0x17001D8F")]
public string EncryptionAlgOid
{
[Token(Token = "0x600BEB7")]
[Address(RVA = "0x2018210", Offset = "0x2017010", VA = "0x182018210")]
get
{
Asn1Object asn1Object = this.encryptionAlgorithm.ToAsn1Object();
throw new NullReferenceException();
}
}
// Token: 0x17001D90 RID: 7568
// (get) Token: 0x0600BEB8 RID: 48824 RVA: 0x002B734C File Offset: 0x002B554C
[Token(Token = "0x17001D90")]
public Asn1Object EncryptionAlgParams
{
[Token(Token = "0x600BEB8")]
[Address(RVA = "0x2018250", Offset = "0x2017050", VA = "0x182018250")]
get
{
DerObjectIdentifier objectID = this.encryptionAlgorithm.ObjectID;
if (objectID == 0)
{
}
return objectID.ToAsn1Object();
}
}
// Token: 0x17001D91 RID: 7569
// (get) Token: 0x0600BEB9 RID: 48825 RVA: 0x002B7378 File Offset: 0x002B5578
[Token(Token = "0x17001D91")]
public BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable SignedAttributes
{
[Token(Token = "0x600BEB9")]
[Address(RVA = "0x20182A0", Offset = "0x20170A0", VA = "0x1820182A0")]
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: 0x17001D92 RID: 7570
// (get) Token: 0x0600BEBA RID: 48826 RVA: 0x002B73B4 File Offset: 0x002B55B4
[Token(Token = "0x17001D92")]
public BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable UnsignedAttributes
{
[Token(Token = "0x600BEBA")]
[Address(RVA = "0x2018320", Offset = "0x2017120", VA = "0x182018320")]
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: 0x0600BEBB RID: 48827 RVA: 0x002B73F0 File Offset: 0x002B55F0
[Token(Token = "0x600BEBB")]
[Address(RVA = "0x2017200", Offset = "0x2016000", VA = "0x182017200")]
public byte[] GetSignature()
{
byte[] array = this.signature;
throw new NullReferenceException();
}
// Token: 0x0600BEBC RID: 48828 RVA: 0x002B740C File Offset: 0x002B560C
[Token(Token = "0x600BEBC")]
[Address(RVA = "0x2016C60", Offset = "0x2015A60", VA = "0x182016C60")]
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: 0x0600BEBD RID: 48829 RVA: 0x002B750C File Offset: 0x002B570C
[Token(Token = "0x600BEBD")]
[Address(RVA = "0x20171B0", Offset = "0x2015FB0", VA = "0x1820171B0")]
public byte[] GetEncodedSignedAttributes()
{
Asn1Set asn1Set = this.signedAttributeSet;
if (asn1Set == 0)
{
}
return asn1Set.GetEncoded("DER");
}
// Token: 0x0600BEBE RID: 48830 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x600BEBE")]
[Address(RVA = "0x2015CC0", Offset = "0x2014AC0", VA = "0x182015CC0")]
private bool DoVerify(AsymmetricKeyParameter key)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x0600BEBF RID: 48831 RVA: 0x002B7534 File Offset: 0x002B5734
[Token(Token = "0x600BEBF")]
[Address(RVA = "0x20175B0", Offset = "0x20163B0", VA = "0x1820175B0")]
private bool IsNull(Asn1Encodable o)
{
return (o != 0 && o != 0) || o == 0;
}
// Token: 0x0600BEC0 RID: 48832 RVA: 0x002B7554 File Offset: 0x002B5754
[Token(Token = "0x600BEC0")]
[Address(RVA = "0x2015BC0", Offset = "0x20149C0", VA = "0x182015BC0")]
private DigestInfo DerDecode(byte[] encoding)
{
/*
An exception occurred when decompiling this method (0600BEC0)
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: 0x0600BEC1 RID: 48833 RVA: 0x002B75A4 File Offset: 0x002B57A4
[Token(Token = "0x600BEC1")]
[Address(RVA = "0x2017780", Offset = "0x2016580", VA = "0x182017780")]
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: 0x0600BEC2 RID: 48834 RVA: 0x002B7704 File Offset: 0x002B5904
[Token(Token = "0x600BEC2")]
[Address(RVA = "0x2017DE0", Offset = "0x2016BE0", VA = "0x182017DE0")]
public bool Verify(AsymmetricKeyParameter pubKey)
{
/*
An exception occurred when decompiling this method (0600BEC2)
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: 0x0600BEC3 RID: 48835 RVA: 0x002B7740 File Offset: 0x002B5940
[Token(Token = "0x600BEC3")]
[Address(RVA = "0x2017D60", Offset = "0x2016B60", VA = "0x182017D60")]
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: 0x0600BEC4 RID: 48836 RVA: 0x002B7768 File Offset: 0x002B5968
[Token(Token = "0x600BEC4")]
[Address(RVA = "0x3F5F40", Offset = "0x3F4D40", VA = "0x1803F5F40")]
public SignerInfo ToSignerInfo()
{
return this.info;
}
// Token: 0x0600BEC5 RID: 48837 RVA: 0x002B777C File Offset: 0x002B597C
[Token(Token = "0x600BEC5")]
[Address(RVA = "0x2017360", Offset = "0x2016160", VA = "0x182017360")]
private Asn1Object GetSingleValuedSignedAttribute(DerObjectIdentifier attrOID, string printableName)
{
/*
An exception occurred when decompiling this method (0600BEC5)
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: 0x0600BEC6 RID: 48838 RVA: 0x002B77EC File Offset: 0x002B59EC
[Token(Token = "0x600BEC6")]
[Address(RVA = "0x2017280", Offset = "0x2016080", VA = "0x182017280")]
private BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.Time GetSigningTime()
{
/*
An exception occurred when decompiling this method (0600BEC6)
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: 0x0600BEC7 RID: 48839 RVA: 0x002B7824 File Offset: 0x002B5A24
[Token(Token = "0x600BEC7")]
[Address(RVA = "0x2017630", Offset = "0x2016430", VA = "0x182017630")]
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: 0x0600BEC8 RID: 48840 RVA: 0x002B78A8 File Offset: 0x002B5AA8
[Token(Token = "0x600BEC8")]
[Address(RVA = "0x2015690", Offset = "0x2014490", VA = "0x182015690")]
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: 0x04007941 RID: 31041
[Token(Token = "0x4007941")]
private static readonly CmsSignedHelper Helper = CmsSignedHelper.Instance;
// Token: 0x04007942 RID: 31042
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007942")]
private SignerID sid;
// Token: 0x04007943 RID: 31043
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007943")]
private SignerInfo info;
// Token: 0x04007944 RID: 31044
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007944")]
private AlgorithmIdentifier digestAlgorithm;
// Token: 0x04007945 RID: 31045
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x4007945")]
private AlgorithmIdentifier encryptionAlgorithm;
// Token: 0x04007946 RID: 31046
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x4007946")]
private readonly Asn1Set signedAttributeSet;
// Token: 0x04007947 RID: 31047
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x4007947")]
private readonly Asn1Set unsignedAttributeSet;
// Token: 0x04007948 RID: 31048
[FieldOffset(Offset = "0x40")]
[Token(Token = "0x4007948")]
private CmsProcessable content;
// Token: 0x04007949 RID: 31049
[FieldOffset(Offset = "0x48")]
[Token(Token = "0x4007949")]
private byte[] signature;
// Token: 0x0400794A RID: 31050
[FieldOffset(Offset = "0x50")]
[Token(Token = "0x400794A")]
private DerObjectIdentifier contentType;
// Token: 0x0400794B RID: 31051
[FieldOffset(Offset = "0x58")]
[Token(Token = "0x400794B")]
private IDigestCalculator digestCalculator;
// Token: 0x0400794C RID: 31052
[FieldOffset(Offset = "0x60")]
[Token(Token = "0x400794C")]
private byte[] resultDigest;
// Token: 0x0400794D RID: 31053
[FieldOffset(Offset = "0x68")]
[Token(Token = "0x400794D")]
private BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable signedAttributeTable;
// Token: 0x0400794E RID: 31054
[FieldOffset(Offset = "0x70")]
[Token(Token = "0x400794E")]
private BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable unsignedAttributeTable;
// Token: 0x0400794F RID: 31055
[FieldOffset(Offset = "0x78")]
[Token(Token = "0x400794F")]
private readonly bool isCounterSignature;
}
}