Files
2026-04-08 23:40:05 +02:00

741 lines
36 KiB
C#

using System;
using System.Collections;
using System.IO;
using System.Runtime.InteropServices;
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: 0x0200178F RID: 6031
[Token(Token = "0x200178F")]
[StructLayout(3)]
public class SignerInformation
{
// Token: 0x0600A2D2 RID: 41682 RVA: 0x0025EBD4 File Offset: 0x0025CDD4
[Token(Token = "0x600A2D2")]
[Address(RVA = "0x668840", Offset = "0x667240", VA = "0x180668840")]
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: 0x0600A2D3 RID: 41683 RVA: 0x0025ED30 File Offset: 0x0025CF30
[Token(Token = "0x600A2D3")]
[Address(RVA = "0x668780", Offset = "0x667180", VA = "0x180668780")]
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: 0x17001986 RID: 6534
// (get) Token: 0x0600A2D4 RID: 41684 RVA: 0x0025EE18 File Offset: 0x0025D018
[Token(Token = "0x17001986")]
public bool IsCounterSignature
{
[Token(Token = "0x600A2D4")]
[Address(RVA = "0x668B70", Offset = "0x667570", VA = "0x180668B70")]
get
{
return this.isCounterSignature;
}
}
// Token: 0x17001987 RID: 6535
// (get) Token: 0x0600A2D5 RID: 41685 RVA: 0x0025EE2C File Offset: 0x0025D02C
[Token(Token = "0x17001987")]
public DerObjectIdentifier ContentType
{
[Token(Token = "0x600A2D5")]
[Address(RVA = "0x462740", Offset = "0x461140", VA = "0x180462740")]
get
{
return this.contentType;
}
}
// Token: 0x17001988 RID: 6536
// (get) Token: 0x0600A2D6 RID: 41686 RVA: 0x0025EE40 File Offset: 0x0025D040
[Token(Token = "0x17001988")]
public SignerID SignerID
{
[Token(Token = "0x600A2D6")]
[Address(RVA = "0x3C39A0", Offset = "0x3C23A0", VA = "0x1803C39A0")]
get
{
return this.sid;
}
}
// Token: 0x17001989 RID: 6537
// (get) Token: 0x0600A2D7 RID: 41687 RVA: 0x0025EE54 File Offset: 0x0025D054
[Token(Token = "0x17001989")]
public int Version
{
[Token(Token = "0x600A2D7")]
[Address(RVA = "0x668C80", Offset = "0x667680", VA = "0x180668C80")]
get
{
return this.info.version.Value.IntValue;
}
}
// Token: 0x1700198A RID: 6538
// (get) Token: 0x0600A2D8 RID: 41688 RVA: 0x0025EE7C File Offset: 0x0025D07C
[Token(Token = "0x1700198A")]
public AlgorithmIdentifier DigestAlgorithmID
{
[Token(Token = "0x600A2D8")]
[Address(RVA = "0x3C1220", Offset = "0x3BFC20", VA = "0x1803C1220")]
get
{
return this.digestAlgorithm;
}
}
// Token: 0x1700198B RID: 6539
// (get) Token: 0x0600A2D9 RID: 41689 RVA: 0x0025EE90 File Offset: 0x0025D090
[Token(Token = "0x1700198B")]
public string DigestAlgOid
{
[Token(Token = "0x600A2D9")]
[Address(RVA = "0x668A50", Offset = "0x667450", VA = "0x180668A50")]
get
{
Asn1Object asn1Object = this.digestAlgorithm.ToAsn1Object();
throw new NullReferenceException();
}
}
// Token: 0x1700198C RID: 6540
// (get) Token: 0x0600A2DA RID: 41690 RVA: 0x0025EEB0 File Offset: 0x0025D0B0
[Token(Token = "0x1700198C")]
public Asn1Object DigestAlgParams
{
[Token(Token = "0x600A2DA")]
[Address(RVA = "0x668A90", Offset = "0x667490", VA = "0x180668A90")]
get
{
DerObjectIdentifier objectID = this.digestAlgorithm.ObjectID;
if (objectID == 0)
{
}
return objectID.ToAsn1Object();
}
}
// Token: 0x0600A2DB RID: 41691 RVA: 0x0025EEDC File Offset: 0x0025D0DC
[Token(Token = "0x600A2DB")]
[Address(RVA = "0x667400", Offset = "0x665E00", VA = "0x180667400")]
public byte[] GetContentDigest()
{
/*
An exception occurred when decompiling this method (0600A2DB)
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: 0x1700198D RID: 6541
// (get) Token: 0x0600A2DC RID: 41692 RVA: 0x0025EEFC File Offset: 0x0025D0FC
[Token(Token = "0x1700198D")]
public AlgorithmIdentifier EncryptionAlgorithmID
{
[Token(Token = "0x600A2DC")]
[Address(RVA = "0x3C1230", Offset = "0x3BFC30", VA = "0x1803C1230")]
get
{
return this.encryptionAlgorithm;
}
}
// Token: 0x1700198E RID: 6542
// (get) Token: 0x0600A2DD RID: 41693 RVA: 0x0025EF10 File Offset: 0x0025D110
[Token(Token = "0x1700198E")]
public string EncryptionAlgOid
{
[Token(Token = "0x600A2DD")]
[Address(RVA = "0x668AE0", Offset = "0x6674E0", VA = "0x180668AE0")]
get
{
Asn1Object asn1Object = this.encryptionAlgorithm.ToAsn1Object();
throw new NullReferenceException();
}
}
// Token: 0x1700198F RID: 6543
// (get) Token: 0x0600A2DE RID: 41694 RVA: 0x0025EF30 File Offset: 0x0025D130
[Token(Token = "0x1700198F")]
public Asn1Object EncryptionAlgParams
{
[Token(Token = "0x600A2DE")]
[Address(RVA = "0x668B20", Offset = "0x667520", VA = "0x180668B20")]
get
{
DerObjectIdentifier objectID = this.encryptionAlgorithm.ObjectID;
if (objectID == 0)
{
}
return objectID.ToAsn1Object();
}
}
// Token: 0x17001990 RID: 6544
// (get) Token: 0x0600A2DF RID: 41695 RVA: 0x0025EF5C File Offset: 0x0025D15C
[Token(Token = "0x17001990")]
public BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable SignedAttributes
{
[Token(Token = "0x600A2DF")]
[Address(RVA = "0x668B80", Offset = "0x667580", VA = "0x180668B80")]
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: 0x17001991 RID: 6545
// (get) Token: 0x0600A2E0 RID: 41696 RVA: 0x0025EF98 File Offset: 0x0025D198
[Token(Token = "0x17001991")]
public BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable UnsignedAttributes
{
[Token(Token = "0x600A2E0")]
[Address(RVA = "0x668C00", Offset = "0x667600", VA = "0x180668C00")]
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: 0x0600A2E1 RID: 41697 RVA: 0x0025EFD4 File Offset: 0x0025D1D4
[Token(Token = "0x600A2E1")]
[Address(RVA = "0x667A90", Offset = "0x666490", VA = "0x180667A90")]
public byte[] GetSignature()
{
byte[] array = this.signature;
throw new NullReferenceException();
}
// Token: 0x0600A2E2 RID: 41698 RVA: 0x0025EFF0 File Offset: 0x0025D1F0
[Token(Token = "0x600A2E2")]
[Address(RVA = "0x6674B0", Offset = "0x665EB0", VA = "0x1806674B0")]
public SignerInformationStore GetCounterSignatures()
{
IList list;
SignerInfo signerInfo;
do
{
BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable unsignedAttributes = this.UnsignedAttributes;
if (unsignedAttributes == 0)
{
goto IL_BA;
}
list = Platform.CreateArrayList();
DerObjectIdentifier counterSignature = CmsAttributes.CounterSignature;
IEnumerator enumerator = unsignedAttributes.GetAll(counterSignature).GetEnumerator();
if (enumerator != 0)
{
if (enumerator == 0 || enumerator == 0)
{
goto IL_F6;
}
CmsSignedHelper instance = CmsSignedHelper.Instance;
Asn1Object asn1Object = signerInfo.digAlgorithm.ToAsn1Object();
byte[] array = this.GetSignature();
CounterSignatureDigestCalculator counterSignatureDigestCalculator;
string text;
counterSignatureDigestCalculator.alg = text;
counterSignatureDigestCalculator.data = array;
int num;
int num2;
SignerInformation signerInformation = new SignerInformation(signerInfo, num, num2, counterSignatureDigestCalculator);
num2 = 0;
num = 0;
if ((uint)(-1) != 0U)
{
}
if ((ulong)((uint)(-1)) != (ulong)(-1L))
{
}
if (signerInfo != 0)
{
goto IL_F0;
}
}
if ((uint)(-1) != 0U)
{
}
if ((ulong)((uint)(-1)) != (ulong)(-1L))
{
}
}
while (signerInfo != 0);
SignerInformationStore signerInformationStore = new SignerInformationStore(list);
IL_BA:
return new SignerInformationStore(Platform.CreateArrayList(0));
IL_F0:
throw new NullReferenceException();
IL_F6:
throw new NullReferenceException();
}
// Token: 0x0600A2E3 RID: 41699 RVA: 0x0025F100 File Offset: 0x0025D300
[Token(Token = "0x600A2E3")]
[Address(RVA = "0x667A40", Offset = "0x666440", VA = "0x180667A40")]
public byte[] GetEncodedSignedAttributes()
{
Asn1Set asn1Set = this.signedAttributeSet;
if (asn1Set == 0)
{
}
return asn1Set.GetEncoded("DER");
}
// Token: 0x0600A2E4 RID: 41700 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x600A2E4")]
[Address(RVA = "0x6664C0", Offset = "0x664EC0", VA = "0x1806664C0")]
private bool DoVerify(AsymmetricKeyParameter key)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x0600A2E5 RID: 41701 RVA: 0x0025F128 File Offset: 0x0025D328
[Token(Token = "0x600A2E5")]
[Address(RVA = "0x667E40", Offset = "0x666840", VA = "0x180667E40")]
private bool IsNull(Asn1Encodable o)
{
return (o != 0 && o != 0) || o == 0;
}
// Token: 0x0600A2E6 RID: 41702 RVA: 0x0025F148 File Offset: 0x0025D348
[Token(Token = "0x600A2E6")]
[Address(RVA = "0x6663C0", Offset = "0x664DC0", VA = "0x1806663C0")]
private DigestInfo DerDecode(byte[] encoding)
{
/*
An exception occurred when decompiling this method (0600A2E6)
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: 0x0600A2E7 RID: 41703 RVA: 0x0025F198 File Offset: 0x0025D398
[Token(Token = "0x600A2E7")]
[Address(RVA = "0x668010", Offset = "0x666A10", VA = "0x180668010")]
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: 0x0600A2E8 RID: 41704 RVA: 0x0025F2F8 File Offset: 0x0025D4F8
[Token(Token = "0x600A2E8")]
[Address(RVA = "0x668670", Offset = "0x667070", VA = "0x180668670")]
public bool Verify(AsymmetricKeyParameter pubKey)
{
/*
An exception occurred when decompiling this method (0600A2E8)
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: 0x0600A2E9 RID: 41705 RVA: 0x0025F334 File Offset: 0x0025D534
[Token(Token = "0x600A2E9")]
[Address(RVA = "0x6685F0", Offset = "0x666FF0", VA = "0x1806685F0")]
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: 0x0600A2EA RID: 41706 RVA: 0x0025F35C File Offset: 0x0025D55C
[Token(Token = "0x600A2EA")]
[Address(RVA = "0x3C1240", Offset = "0x3BFC40", VA = "0x1803C1240")]
public SignerInfo ToSignerInfo()
{
return this.info;
}
// Token: 0x0600A2EB RID: 41707 RVA: 0x0025F370 File Offset: 0x0025D570
[Token(Token = "0x600A2EB")]
[Address(RVA = "0x667BF0", Offset = "0x6665F0", VA = "0x180667BF0")]
private Asn1Object GetSingleValuedSignedAttribute(DerObjectIdentifier attrOID, string printableName)
{
/*
An exception occurred when decompiling this method (0600A2EB)
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: 0x0600A2EC RID: 41708 RVA: 0x0025F3E0 File Offset: 0x0025D5E0
[Token(Token = "0x600A2EC")]
[Address(RVA = "0x667B10", Offset = "0x666510", VA = "0x180667B10")]
private BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.Time GetSigningTime()
{
/*
An exception occurred when decompiling this method (0600A2EC)
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: 0x0600A2ED RID: 41709 RVA: 0x0025F418 File Offset: 0x0025D618
[Token(Token = "0x600A2ED")]
[Address(RVA = "0x667EC0", Offset = "0x6668C0", VA = "0x180667EC0")]
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: 0x0600A2EE RID: 41710 RVA: 0x0025F49C File Offset: 0x0025D69C
[Token(Token = "0x600A2EE")]
[Address(RVA = "0x665E40", Offset = "0x664840", VA = "0x180665E40")]
public static SignerInformation AddCounterSigners(SignerInformation signerInformation, SignerInformationStore counterSigners)
{
int num;
Asn1EncodableVector asn1EncodableVector2;
do
{
num = 0;
BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable unsignedAttributes = signerInformation.UnsignedAttributes;
if (unsignedAttributes == 0)
{
}
Asn1EncodableVector 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_C9;
}
array = new Asn1Encodable[1];
if (list != 0)
{
}
array[0] = list;
asn1EncodableVector2.Add(array);
}
if (array != 0)
{
}
if (num != -1)
{
}
}
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;
throw new NullReferenceException();
IL_C9:
throw new NullReferenceException();
}
// Token: 0x04006AFE RID: 27390
[Token(Token = "0x4006AFE")]
private static readonly CmsSignedHelper Helper = CmsSignedHelper.Instance;
// Token: 0x04006AFF RID: 27391
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006AFF")]
private SignerID sid;
// Token: 0x04006B00 RID: 27392
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x4006B00")]
private SignerInfo info;
// Token: 0x04006B01 RID: 27393
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
[Token(Token = "0x4006B01")]
private AlgorithmIdentifier digestAlgorithm;
// Token: 0x04006B02 RID: 27394
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
[Token(Token = "0x4006B02")]
private AlgorithmIdentifier encryptionAlgorithm;
// Token: 0x04006B03 RID: 27395
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
[Token(Token = "0x4006B03")]
private readonly Asn1Set signedAttributeSet;
// Token: 0x04006B04 RID: 27396
[global::Cpp2IlInjected.FieldOffset(Offset = "0x38")]
[Token(Token = "0x4006B04")]
private readonly Asn1Set unsignedAttributeSet;
// Token: 0x04006B05 RID: 27397
[global::Cpp2IlInjected.FieldOffset(Offset = "0x40")]
[Token(Token = "0x4006B05")]
private CmsProcessable content;
// Token: 0x04006B06 RID: 27398
[global::Cpp2IlInjected.FieldOffset(Offset = "0x48")]
[Token(Token = "0x4006B06")]
private byte[] signature;
// Token: 0x04006B07 RID: 27399
[global::Cpp2IlInjected.FieldOffset(Offset = "0x50")]
[Token(Token = "0x4006B07")]
private DerObjectIdentifier contentType;
// Token: 0x04006B08 RID: 27400
[global::Cpp2IlInjected.FieldOffset(Offset = "0x58")]
[Token(Token = "0x4006B08")]
private IDigestCalculator digestCalculator;
// Token: 0x04006B09 RID: 27401
[global::Cpp2IlInjected.FieldOffset(Offset = "0x60")]
[Token(Token = "0x4006B09")]
private byte[] resultDigest;
// Token: 0x04006B0A RID: 27402
[global::Cpp2IlInjected.FieldOffset(Offset = "0x68")]
[Token(Token = "0x4006B0A")]
private BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable signedAttributeTable;
// Token: 0x04006B0B RID: 27403
[global::Cpp2IlInjected.FieldOffset(Offset = "0x70")]
[Token(Token = "0x4006B0B")]
private BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable unsignedAttributeTable;
// Token: 0x04006B0C RID: 27404
[global::Cpp2IlInjected.FieldOffset(Offset = "0x78")]
[Token(Token = "0x4006B0C")]
private readonly bool isCounterSignature;
}
}