944 lines
42 KiB
C#
944 lines
42 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.Crypto.IO;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.X509;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
|
|
{
|
|
// Token: 0x02001E28 RID: 7720
|
|
[Token(Token = "0x2001E28")]
|
|
public class CmsSignedDataStreamGenerator : CmsSignedGenerator
|
|
{
|
|
// Token: 0x0600C19F RID: 49567 RVA: 0x002BBA28 File Offset: 0x002B9C28
|
|
[Token(Token = "0x600C19F")]
|
|
[Address(RVA = "0x2923F00", Offset = "0x2922F00", VA = "0x182923F00")]
|
|
public CmsSignedDataStreamGenerator()
|
|
{
|
|
IList list = Platform.CreateArrayList();
|
|
this._signerInfs = list;
|
|
HashSet hashSet = new HashSet();
|
|
this._messageDigestOids = hashSet;
|
|
IDictionary dictionary = Platform.CreateHashtable();
|
|
this._messageDigests = dictionary;
|
|
IDictionary dictionary2 = Platform.CreateHashtable();
|
|
this._messageHashes = dictionary2;
|
|
SecureRandom secureRandom = new SecureRandom();
|
|
base..ctor(secureRandom);
|
|
}
|
|
|
|
// Token: 0x0600C1A0 RID: 49568 RVA: 0x002BBA84 File Offset: 0x002B9C84
|
|
[Token(Token = "0x600C1A0")]
|
|
[Address(RVA = "0x2923FF0", Offset = "0x2922FF0", VA = "0x182923FF0")]
|
|
public CmsSignedDataStreamGenerator(SecureRandom rand)
|
|
{
|
|
IList list = Platform.CreateArrayList();
|
|
this._signerInfs = list;
|
|
HashSet hashSet = new HashSet();
|
|
this._messageDigestOids = hashSet;
|
|
IDictionary dictionary = Platform.CreateHashtable();
|
|
this._messageDigests = dictionary;
|
|
IDictionary dictionary2 = Platform.CreateHashtable();
|
|
this._messageHashes = dictionary2;
|
|
base..ctor(rand);
|
|
}
|
|
|
|
// Token: 0x0600C1A1 RID: 49569 RVA: 0x002BBAD8 File Offset: 0x002B9CD8
|
|
[Token(Token = "0x600C1A1")]
|
|
[Address(RVA = "0xED62D0", Offset = "0xED52D0", VA = "0x180ED62D0")]
|
|
public void SetBufferSize(int bufferSize)
|
|
{
|
|
this._bufferSize = bufferSize;
|
|
}
|
|
|
|
// Token: 0x0600C1A2 RID: 49570 RVA: 0x002BBAEC File Offset: 0x002B9CEC
|
|
[Token(Token = "0x600C1A2")]
|
|
[Address(RVA = "0x2921BF0", Offset = "0x2920BF0", VA = "0x182921BF0")]
|
|
public void AddDigests(params string[] digestOids)
|
|
{
|
|
this.AddDigests(digestOids);
|
|
}
|
|
|
|
// Token: 0x0600C1A3 RID: 49571 RVA: 0x002BBB00 File Offset: 0x002B9D00
|
|
[Token(Token = "0x600C1A3")]
|
|
[Address(RVA = "0x2921C00", Offset = "0x2920C00", VA = "0x182921C00")]
|
|
public void AddDigests(IEnumerable digestOids)
|
|
{
|
|
int num;
|
|
do
|
|
{
|
|
num = 0;
|
|
num += num;
|
|
num++;
|
|
if (num != 0 && num == 0)
|
|
{
|
|
goto IL_2F;
|
|
}
|
|
this.ConfigureDigest(num);
|
|
num += num;
|
|
num++;
|
|
num += 19;
|
|
if (num != 0)
|
|
{
|
|
}
|
|
}
|
|
while (num != 0);
|
|
return;
|
|
IL_2F:
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0600C1A4 RID: 49572 RVA: 0x002BBB44 File Offset: 0x002B9D44
|
|
[Token(Token = "0x600C1A4")]
|
|
[Address(RVA = "0x2922400", Offset = "0x2921400", VA = "0x182922400")]
|
|
public void AddSigner(AsymmetricKeyParameter privateKey, X509Certificate cert, string digestOid)
|
|
{
|
|
DefaultSignedAttributeTableGenerator defaultSignedAttributeTableGenerator = new DefaultSignedAttributeTableGenerator();
|
|
IDictionary dictionary = Platform.CreateHashtable();
|
|
defaultSignedAttributeTableGenerator.table = dictionary;
|
|
int num = 0;
|
|
this.AddSigner(privateKey, cert, digestOid, defaultSignedAttributeTableGenerator, num);
|
|
}
|
|
|
|
// Token: 0x0600C1A5 RID: 49573 RVA: 0x002BBB74 File Offset: 0x002B9D74
|
|
[Token(Token = "0x600C1A5")]
|
|
[Address(RVA = "0x2921E00", Offset = "0x2920E00", VA = "0x182921E00")]
|
|
public void AddSigner(AsymmetricKeyParameter privateKey, X509Certificate cert, string encryptionOid, string digestOid)
|
|
{
|
|
DefaultSignedAttributeTableGenerator defaultSignedAttributeTableGenerator = new DefaultSignedAttributeTableGenerator();
|
|
IDictionary dictionary = Platform.CreateHashtable();
|
|
defaultSignedAttributeTableGenerator.table = dictionary;
|
|
}
|
|
|
|
// Token: 0x0600C1A6 RID: 49574 RVA: 0x002BBB98 File Offset: 0x002B9D98
|
|
[Token(Token = "0x600C1A6")]
|
|
[Address(RVA = "0x2921FC0", Offset = "0x2920FC0", VA = "0x182921FC0")]
|
|
public void AddSigner(AsymmetricKeyParameter privateKey, X509Certificate cert, string digestOid, BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable signedAttr, BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable unsignedAttr)
|
|
{
|
|
int num = 0;
|
|
int num2 = 0;
|
|
SimpleAttributeTableGenerator simpleAttributeTableGenerator;
|
|
simpleAttributeTableGenerator.FieldGetter(num2, num, digestOid);
|
|
simpleAttributeTableGenerator.attributes = 0;
|
|
}
|
|
|
|
// Token: 0x0600C1A7 RID: 49575 RVA: 0x002BBBBC File Offset: 0x002B9DBC
|
|
[Token(Token = "0x600C1A7")]
|
|
[Address(RVA = "0x2922330", Offset = "0x2921330", VA = "0x182922330")]
|
|
public void AddSigner(AsymmetricKeyParameter privateKey, X509Certificate cert, string encryptionOid, string digestOid, BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable signedAttr, BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable unsignedAttr)
|
|
{
|
|
int num = 0;
|
|
int num2 = 0;
|
|
SimpleAttributeTableGenerator simpleAttributeTableGenerator;
|
|
simpleAttributeTableGenerator.FieldGetter(num2, num, encryptionOid);
|
|
simpleAttributeTableGenerator.attributes = 0;
|
|
}
|
|
|
|
// Token: 0x0600C1A8 RID: 49576 RVA: 0x002BBBE0 File Offset: 0x002B9DE0
|
|
[Token(Token = "0x600C1A8")]
|
|
[Address(RVA = "0x2921EF0", Offset = "0x2920EF0", VA = "0x182921EF0")]
|
|
public void AddSigner(AsymmetricKeyParameter privateKey, X509Certificate cert, string digestOid, CmsAttributeTableGenerator signedAttrGenerator, CmsAttributeTableGenerator unsignedAttrGenerator)
|
|
{
|
|
string encOid = CmsSignedDataStreamGenerator.Helper.GetEncOid(privateKey, digestOid);
|
|
}
|
|
|
|
// Token: 0x0600C1A9 RID: 49577 RVA: 0x002BBC00 File Offset: 0x002B9E00
|
|
[Token(Token = "0x600C1A9")]
|
|
[Address(RVA = "0x29226A0", Offset = "0x29216A0", VA = "0x1829226A0")]
|
|
public void AddSigner(AsymmetricKeyParameter privateKey, X509Certificate cert, string encryptionOid, string digestOid, CmsAttributeTableGenerator signedAttrGenerator, CmsAttributeTableGenerator unsignedAttrGenerator)
|
|
{
|
|
DateTime notAfter = cert.NotAfter;
|
|
Asn1Object asn1Object;
|
|
TbsCertificateStructure instance = TbsCertificateStructure.GetInstance(asn1Object);
|
|
DerInteger serialNumber = instance.serialNumber;
|
|
X509Name issuer = instance.issuer;
|
|
BigInteger value = serialNumber.Value;
|
|
SignerIdentifier signerIdentifier = new SignerIdentifier(new IssuerAndSerialNumber(issuer, value));
|
|
}
|
|
|
|
// Token: 0x0600C1AA RID: 49578 RVA: 0x002BBC48 File Offset: 0x002B9E48
|
|
[Token(Token = "0x600C1AA")]
|
|
[Address(RVA = "0x2922250", Offset = "0x2921250", VA = "0x182922250")]
|
|
public void AddSigner(AsymmetricKeyParameter privateKey, byte[] subjectKeyID, string digestOid)
|
|
{
|
|
DefaultSignedAttributeTableGenerator defaultSignedAttributeTableGenerator = new DefaultSignedAttributeTableGenerator();
|
|
IDictionary dictionary = Platform.CreateHashtable();
|
|
defaultSignedAttributeTableGenerator.table = dictionary;
|
|
int num = 0;
|
|
this.AddSigner(privateKey, subjectKeyID, digestOid, defaultSignedAttributeTableGenerator, num);
|
|
}
|
|
|
|
// Token: 0x0600C1AB RID: 49579 RVA: 0x002BBC78 File Offset: 0x002B9E78
|
|
[Token(Token = "0x600C1AB")]
|
|
[Address(RVA = "0x29224E0", Offset = "0x29214E0", VA = "0x1829224E0")]
|
|
public void AddSigner(AsymmetricKeyParameter privateKey, byte[] subjectKeyID, string encryptionOid, string digestOid)
|
|
{
|
|
DefaultSignedAttributeTableGenerator defaultSignedAttributeTableGenerator = new DefaultSignedAttributeTableGenerator();
|
|
IDictionary dictionary = Platform.CreateHashtable();
|
|
defaultSignedAttributeTableGenerator.table = dictionary;
|
|
}
|
|
|
|
// Token: 0x0600C1AC RID: 49580 RVA: 0x002BBC9C File Offset: 0x002B9E9C
|
|
[Token(Token = "0x600C1AC")]
|
|
[Address(RVA = "0x2922180", Offset = "0x2921180", VA = "0x182922180")]
|
|
public void AddSigner(AsymmetricKeyParameter privateKey, byte[] subjectKeyID, string digestOid, BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable signedAttr, BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable unsignedAttr)
|
|
{
|
|
int num = 0;
|
|
int num2 = 0;
|
|
SimpleAttributeTableGenerator simpleAttributeTableGenerator;
|
|
simpleAttributeTableGenerator.FieldGetter(num2, num, digestOid);
|
|
simpleAttributeTableGenerator.attributes = 0;
|
|
}
|
|
|
|
// Token: 0x0600C1AD RID: 49581 RVA: 0x002BBCC0 File Offset: 0x002B9EC0
|
|
[Token(Token = "0x600C1AD")]
|
|
[Address(RVA = "0x29225D0", Offset = "0x29215D0", VA = "0x1829225D0")]
|
|
public void AddSigner(AsymmetricKeyParameter privateKey, byte[] subjectKeyID, string digestOid, CmsAttributeTableGenerator signedAttrGenerator, CmsAttributeTableGenerator unsignedAttrGenerator)
|
|
{
|
|
string encOid = CmsSignedDataStreamGenerator.Helper.GetEncOid(privateKey, digestOid);
|
|
}
|
|
|
|
// Token: 0x0600C1AE RID: 49582 RVA: 0x002BBCE0 File Offset: 0x002B9EE0
|
|
[Token(Token = "0x600C1AE")]
|
|
[Address(RVA = "0x2922090", Offset = "0x2921090", VA = "0x182922090")]
|
|
public void AddSigner(AsymmetricKeyParameter privateKey, byte[] subjectKeyID, string encryptionOid, string digestOid, CmsAttributeTableGenerator signedAttrGenerator, CmsAttributeTableGenerator unsignedAttrGenerator)
|
|
{
|
|
SignerIdentifier signerIdentifier = new SignerIdentifier(new DerOctetString(subjectKeyID));
|
|
}
|
|
|
|
// Token: 0x0600C1AF RID: 49583 RVA: 0x002BBCFC File Offset: 0x002B9EFC
|
|
[Token(Token = "0x600C1AF")]
|
|
[Address(RVA = "0x29231A0", Offset = "0x29221A0", VA = "0x1829231A0")]
|
|
private void DoAddSigner(AsymmetricKeyParameter privateKey, SignerIdentifier signerIdentifier, string encryptionOid, string digestOid, CmsAttributeTableGenerator signedAttrGenerator, CmsAttributeTableGenerator unsignedAttrGenerator)
|
|
{
|
|
IList signerInfs = this._signerInfs;
|
|
CmsSignedDataStreamGenerator.DigestAndSignerInfoGeneratorHolder digestAndSignerInfoGeneratorHolder;
|
|
CmsSignedDataStreamGenerator.SignerInfoGeneratorImpl signerInfoGeneratorImpl;
|
|
digestAndSignerInfoGeneratorHolder.signerInf = signerInfoGeneratorImpl;
|
|
digestAndSignerInfoGeneratorHolder.digestOID = 0;
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0600C1B0 RID: 49584 RVA: 0x002BBD24 File Offset: 0x002B9F24
|
|
[Token(Token = "0x600C1B0")]
|
|
[Address(RVA = "0x2921DB0", Offset = "0x2920DB0", VA = "0x182921DB0", Slot = "6")]
|
|
internal override void AddSignerCallback(SignerInformation si)
|
|
{
|
|
Asn1Object asn1Object = si.digestAlgorithm.ToAsn1Object();
|
|
}
|
|
|
|
// Token: 0x0600C1B1 RID: 49585 RVA: 0x002BBD44 File Offset: 0x002B9F44
|
|
[Token(Token = "0x600C1B1")]
|
|
[Address(RVA = "0x2923620", Offset = "0x2922620", VA = "0x182923620")]
|
|
public Stream Open(Stream outStream)
|
|
{
|
|
int num = 0;
|
|
int num2 = 0;
|
|
string data = CmsSignedGenerator.Data;
|
|
return this.Open(outStream, data, num2 != 0, num);
|
|
}
|
|
|
|
// Token: 0x0600C1B2 RID: 49586 RVA: 0x002BBD68 File Offset: 0x002B9F68
|
|
[Token(Token = "0x600C1B2")]
|
|
[Address(RVA = "0x2923580", Offset = "0x2922580", VA = "0x182923580")]
|
|
public Stream Open(Stream outStream, bool encapsulate)
|
|
{
|
|
int num = 0;
|
|
string data = CmsSignedGenerator.Data;
|
|
return this.Open(outStream, data, encapsulate, num);
|
|
}
|
|
|
|
// Token: 0x0600C1B3 RID: 49587 RVA: 0x002BBD88 File Offset: 0x002B9F88
|
|
[Token(Token = "0x600C1B3")]
|
|
[Address(RVA = "0x29234E0", Offset = "0x29224E0", VA = "0x1829234E0")]
|
|
public Stream Open(Stream outStream, bool encapsulate, Stream dataOutputStream)
|
|
{
|
|
string data = CmsSignedGenerator.Data;
|
|
return this.Open(outStream, data, encapsulate, dataOutputStream);
|
|
}
|
|
|
|
// Token: 0x0600C1B4 RID: 49588 RVA: 0x002BBDA8 File Offset: 0x002B9FA8
|
|
[Token(Token = "0x600C1B4")]
|
|
[Address(RVA = "0x2923DC0", Offset = "0x2922DC0", VA = "0x182923DC0")]
|
|
public Stream Open(Stream outStream, string signedContentType, bool encapsulate)
|
|
{
|
|
int num = 0;
|
|
return this.Open(outStream, signedContentType, encapsulate, num);
|
|
}
|
|
|
|
// Token: 0x0600C1B5 RID: 49589 RVA: 0x002BBDC4 File Offset: 0x002B9FC4
|
|
[Token(Token = "0x600C1B5")]
|
|
[Address(RVA = "0x29236B0", Offset = "0x29226B0", VA = "0x1829236B0")]
|
|
public Stream Open(Stream outStream, string signedContentType, bool encapsulate, Stream dataOutputStream)
|
|
{
|
|
int num;
|
|
Asn1EncodableVector asn1EncodableVector;
|
|
for (;;)
|
|
{
|
|
num = 0;
|
|
if (outStream == 0)
|
|
{
|
|
goto IL_11A;
|
|
}
|
|
if (outStream.CanSeek)
|
|
{
|
|
if (outStream != 0 && !outStream.CanSeek)
|
|
{
|
|
goto IL_126;
|
|
}
|
|
this._messageDigestsLocked = true;
|
|
string text = new BerSequenceGenerator(outStream).ToString();
|
|
if (signedContentType == 0)
|
|
{
|
|
}
|
|
DerObjectIdentifier derObjectIdentifier = new DerObjectIdentifier(signedContentType);
|
|
DerInteger derInteger = this.CalculateVersion(derObjectIdentifier);
|
|
BerSequenceGenerator berSequenceGenerator;
|
|
string text2 = berSequenceGenerator.ToString();
|
|
ISet messageDigestOids = this._messageDigestOids;
|
|
if (asn1EncodableVector != 0)
|
|
{
|
|
break;
|
|
}
|
|
ArrayTypeMismatchException ex;
|
|
if (ex != 0)
|
|
{
|
|
}
|
|
if (num == 0)
|
|
{
|
|
goto Block_5;
|
|
}
|
|
}
|
|
}
|
|
DerNull instance;
|
|
if (asn1EncodableVector == 0 || asn1EncodableVector != 0)
|
|
{
|
|
Asn1Encodable[] array = new Asn1Encodable[1];
|
|
DerObjectIdentifier derObjectIdentifier2 = new DerObjectIdentifier(num);
|
|
instance = DerNull.Instance;
|
|
AlgorithmIdentifier algorithmIdentifier = new AlgorithmIdentifier(derObjectIdentifier2, instance);
|
|
throw new ArrayTypeMismatchException();
|
|
}
|
|
throw new NullReferenceException();
|
|
Block_5:
|
|
byte[] encoded = new DerSet(asn1EncodableVector).GetEncoded();
|
|
Asn1Object asn1Object = instance.ToAsn1Object();
|
|
Asn1Object asn1Object2 = instance.ToAsn1Object();
|
|
BerSequenceGenerator berSequenceGenerator2;
|
|
string text3 = berSequenceGenerator2.ToString();
|
|
int num2 = 0;
|
|
CmsSignedDataStreamGenerator.CmsSignedDataOutputStream cmsSignedDataOutputStream;
|
|
cmsSignedDataOutputStream.outer = asn1EncodableVector;
|
|
Stream stream;
|
|
cmsSignedDataOutputStream._out = stream;
|
|
DerObjectIdentifier derObjectIdentifier3 = new DerObjectIdentifier(num2);
|
|
cmsSignedDataOutputStream._contentOID = derObjectIdentifier3;
|
|
cmsSignedDataOutputStream._sGen = derObjectIdentifier3;
|
|
cmsSignedDataOutputStream._eiGen = berSequenceGenerator2;
|
|
IL_11A:
|
|
ArgumentNullException ex2 = new ArgumentNullException("outStream");
|
|
IL_126:
|
|
ArgumentException ex3 = new ArgumentException("Expected writeable stream", "dataOutputStream");
|
|
throw new IndexOutOfRangeException();
|
|
}
|
|
|
|
// Token: 0x0600C1B6 RID: 49590 RVA: 0x002BBF20 File Offset: 0x002BA120
|
|
[Token(Token = "0x600C1B6")]
|
|
[Address(RVA = "0x2923DE0", Offset = "0x2922DE0", VA = "0x182923DE0")]
|
|
private void RegisterDigestOid(string digestOid)
|
|
{
|
|
ISet messageDigestOids = this._messageDigestOids;
|
|
if (!this._messageDigestsLocked)
|
|
{
|
|
return;
|
|
}
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0600C1B7 RID: 49591 RVA: 0x002BBF50 File Offset: 0x002BA150
|
|
[Token(Token = "0x600C1B7")]
|
|
[Address(RVA = "0x2923000", Offset = "0x2922000", VA = "0x182923000")]
|
|
private void ConfigureDigest(string digestOid)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600C1B7)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsSignedDataStreamGenerator::ConfigureDigest(System.String)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_45:
|
|
stloc:InvalidOperationException(var_4_4F, newobj:InvalidOperationException(InvalidOperationException::.ctor, ldstr:string("Cannot configure new digests after the data stream is opened")))
|
|
}
|
|
|
|
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: 0x0600C1B8 RID: 49592 RVA: 0x002BBFB0 File Offset: 0x002BA1B0
|
|
[Token(Token = "0x600C1B8")]
|
|
[Address(RVA = "0x29232B0", Offset = "0x29222B0", VA = "0x1829232B0")]
|
|
internal void Generate(Stream outStream, string eContentType, bool encapsulate, Stream dataOutputStream, CmsProcessable content)
|
|
{
|
|
}
|
|
|
|
// Token: 0x0600C1B9 RID: 49593 RVA: 0x002BBFC0 File Offset: 0x002BA1C0
|
|
[Token(Token = "0x600C1B9")]
|
|
[Address(RVA = "0x29229B0", Offset = "0x29219B0", VA = "0x1829229B0")]
|
|
private DerInteger CalculateVersion(DerObjectIdentifier contentOid)
|
|
{
|
|
int num;
|
|
do
|
|
{
|
|
num = 0;
|
|
if (this._certs != 0)
|
|
{
|
|
if (num != 0)
|
|
{
|
|
goto IL_6D;
|
|
}
|
|
if (num != -1)
|
|
{
|
|
}
|
|
if ((ulong)1L != 0UL)
|
|
{
|
|
goto IL_60;
|
|
}
|
|
}
|
|
if (this._crls == 0)
|
|
{
|
|
break;
|
|
}
|
|
if ((uint)(-1) != 0U)
|
|
{
|
|
}
|
|
}
|
|
while (num != 0);
|
|
DerObjectIdentifier data = CmsObjectIdentifiers.Data;
|
|
IList signers = this._signers;
|
|
if (!this.CheckForVersion3(signers))
|
|
{
|
|
DerInteger derInteger = new DerInteger(5);
|
|
}
|
|
DerInteger derInteger2 = new DerInteger(5);
|
|
DerInteger derInteger3 = new DerInteger(5);
|
|
IL_60:
|
|
return new DerInteger(5);
|
|
IL_6D:
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0600C1BA RID: 49594 RVA: 0x002BC040 File Offset: 0x002BA240
|
|
[Token(Token = "0x600C1BA")]
|
|
[Address(RVA = "0x2922DB0", Offset = "0x2921DB0", VA = "0x182922DB0")]
|
|
private bool CheckForVersion3(IList signerInfos)
|
|
{
|
|
int num;
|
|
do
|
|
{
|
|
num = 0;
|
|
SignerInfo signerInfo;
|
|
int intValue = signerInfo.version.Value.IntValue;
|
|
while (intValue != 3)
|
|
{
|
|
}
|
|
if (intValue != 0)
|
|
{
|
|
}
|
|
}
|
|
while (num != 0);
|
|
if (num != -1)
|
|
{
|
|
return true;
|
|
}
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0600C1BB RID: 49595 RVA: 0x002BC0A0 File Offset: 0x002BA2A0
|
|
[Token(Token = "0x600C1BB")]
|
|
[Address(RVA = "0x2922800", Offset = "0x2921800", VA = "0x182922800")]
|
|
private static Stream AttachDigestsToOutputStream(ICollection digests, Stream s)
|
|
{
|
|
int num;
|
|
Stream safeTeeOutputStream;
|
|
do
|
|
{
|
|
num = 0;
|
|
DigestSink digestSink;
|
|
safeTeeOutputStream = CmsSignedDataStreamGenerator.GetSafeTeeOutputStream(s, digestSink);
|
|
if (safeTeeOutputStream != 0)
|
|
{
|
|
}
|
|
}
|
|
while (num != 0);
|
|
return safeTeeOutputStream;
|
|
}
|
|
|
|
// Token: 0x0600C1BC RID: 49596 RVA: 0x002BC0CC File Offset: 0x002BA2CC
|
|
[Token(Token = "0x600C1BC")]
|
|
[Address(RVA = "0x2923370", Offset = "0x2922370", VA = "0x182923370")]
|
|
private static Stream GetSafeOutputStream(Stream s)
|
|
{
|
|
if (s == 0)
|
|
{
|
|
NullOutputStream nullOutputStream = new NullOutputStream();
|
|
}
|
|
return s;
|
|
}
|
|
|
|
// Token: 0x0600C1BD RID: 49597 RVA: 0x002BC0E4 File Offset: 0x002BA2E4
|
|
[Token(Token = "0x600C1BD")]
|
|
[Address(RVA = "0x29233C0", Offset = "0x29223C0", VA = "0x1829233C0")]
|
|
private static Stream GetSafeTeeOutputStream(Stream s1, Stream s2)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600C1BD)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.IO.Stream BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsSignedDataStreamGenerator::GetSafeTeeOutputStream(System.IO.Stream,System.IO.Stream)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
Block_2:
|
|
stloc:NullOutputStream(var_1_1B, newobj:NullOutputStream(NullOutputStream::.ctor))
|
|
}
|
|
|
|
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.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: 0x04007A8C RID: 31372
|
|
[Token(Token = "0x4007A8C")]
|
|
private static readonly CmsSignedHelper Helper = CmsSignedHelper.Instance;
|
|
|
|
// Token: 0x04007A8D RID: 31373
|
|
[FieldOffset(Offset = "0x40")]
|
|
[Token(Token = "0x4007A8D")]
|
|
private readonly IList _signerInfs;
|
|
|
|
// Token: 0x04007A8E RID: 31374
|
|
[FieldOffset(Offset = "0x48")]
|
|
[Token(Token = "0x4007A8E")]
|
|
private readonly ISet _messageDigestOids;
|
|
|
|
// Token: 0x04007A8F RID: 31375
|
|
[FieldOffset(Offset = "0x50")]
|
|
[Token(Token = "0x4007A8F")]
|
|
private readonly IDictionary _messageDigests;
|
|
|
|
// Token: 0x04007A90 RID: 31376
|
|
[FieldOffset(Offset = "0x58")]
|
|
[Token(Token = "0x4007A90")]
|
|
private readonly IDictionary _messageHashes;
|
|
|
|
// Token: 0x04007A91 RID: 31377
|
|
[FieldOffset(Offset = "0x60")]
|
|
[Token(Token = "0x4007A91")]
|
|
private bool _messageDigestsLocked;
|
|
|
|
// Token: 0x04007A92 RID: 31378
|
|
[FieldOffset(Offset = "0x64")]
|
|
[Token(Token = "0x4007A92")]
|
|
private int _bufferSize;
|
|
|
|
// Token: 0x02001E29 RID: 7721
|
|
[Token(Token = "0x2001E29")]
|
|
private class DigestAndSignerInfoGeneratorHolder
|
|
{
|
|
// Token: 0x0600C1BF RID: 49599 RVA: 0x002BC124 File Offset: 0x002BA324
|
|
[Token(Token = "0x600C1BF")]
|
|
[Address(RVA = "0x417DD0", Offset = "0x416DD0", VA = "0x180417DD0")]
|
|
internal DigestAndSignerInfoGeneratorHolder(ISignerInfoGenerator signerInf, string digestOID)
|
|
{
|
|
this.signerInf = signerInf;
|
|
this.digestOID = digestOID;
|
|
}
|
|
|
|
// Token: 0x17001E09 RID: 7689
|
|
// (get) Token: 0x0600C1C0 RID: 49600 RVA: 0x002BC148 File Offset: 0x002BA348
|
|
[Token(Token = "0x17001E09")]
|
|
internal AlgorithmIdentifier DigestAlgorithm
|
|
{
|
|
[Token(Token = "0x600C1C0")]
|
|
[Address(RVA = "0x292C4B0", Offset = "0x292B4B0", VA = "0x18292C4B0")]
|
|
get
|
|
{
|
|
DerObjectIdentifier derObjectIdentifier = new DerObjectIdentifier(this.digestOID);
|
|
DerNull instance = DerNull.Instance;
|
|
return new AlgorithmIdentifier(derObjectIdentifier, instance);
|
|
}
|
|
}
|
|
|
|
// Token: 0x04007A93 RID: 31379
|
|
[FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x4007A93")]
|
|
internal readonly ISignerInfoGenerator signerInf;
|
|
|
|
// Token: 0x04007A94 RID: 31380
|
|
[FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x4007A94")]
|
|
internal readonly string digestOID;
|
|
}
|
|
|
|
// Token: 0x02001E2A RID: 7722
|
|
[Token(Token = "0x2001E2A")]
|
|
private class SignerInfoGeneratorImpl : ISignerInfoGenerator
|
|
{
|
|
// Token: 0x0600C1C1 RID: 49601 RVA: 0x002BC170 File Offset: 0x002BA370
|
|
[Token(Token = "0x600C1C1")]
|
|
[Address(RVA = "0x29356F0", Offset = "0x29346F0", VA = "0x1829356F0")]
|
|
internal SignerInfoGeneratorImpl(CmsSignedDataStreamGenerator outer, AsymmetricKeyParameter key, SignerIdentifier signerIdentifier, string digestOID, string encOID, CmsAttributeTableGenerator sAttr, CmsAttributeTableGenerator unsAttr)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600C1C1)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsSignedDataStreamGenerator/SignerInfoGeneratorImpl::.ctor(BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsSignedDataStreamGenerator,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.AsymmetricKeyParameter,BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.SignerIdentifier,System.String,System.String,BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsAttributeTableGenerator,BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsAttributeTableGenerator)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_E3:
|
|
stloc:SignatureException(var_12_EA, newobj:SignatureException(SignatureException::.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.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.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: 0x0600C1C2 RID: 49602 RVA: 0x002BC268 File Offset: 0x002BA468
|
|
[Token(Token = "0x600C1C2")]
|
|
[Address(RVA = "0x29350B0", Offset = "0x29340B0", VA = "0x1829350B0", Slot = "4")]
|
|
public SignerInfo Generate(DerObjectIdentifier contentType, AlgorithmIdentifier digestAlgorithm, byte[] calculatedDigest)
|
|
{
|
|
CmsSignedHelper helper = CmsSignedDataStreamGenerator.Helper;
|
|
string digestOID = this._digestOID;
|
|
string digestAlgName = helper.GetDigestAlgName(digestOID);
|
|
string encName = this._encName;
|
|
string text = digestAlgName + "with" + encName;
|
|
int num = 0;
|
|
if (this._sAttr == num)
|
|
{
|
|
if (!this._encName.Equals("RSA"))
|
|
{
|
|
goto IL_98;
|
|
}
|
|
byte[] encoded = new DigestInfo(digestAlgorithm, calculatedDigest).GetEncoded("DER");
|
|
}
|
|
string text2 = this.outer.ToString();
|
|
CmsAttributeTableGenerator sAttr = this._sAttr;
|
|
if (contentType == 0 && text2 != 0)
|
|
{
|
|
DerObjectIdentifier contentType2 = CmsAttributes.ContentType;
|
|
BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.Attribute attribute;
|
|
if (attribute != 0)
|
|
{
|
|
IDictionary dictionary;
|
|
BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable attributeTable = new BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.AttributeTable(dictionary);
|
|
}
|
|
}
|
|
CmsSignedDataStreamGenerator cmsSignedDataStreamGenerator = this.outer;
|
|
IL_98:
|
|
ISigner sig = this._sig;
|
|
byte[] array;
|
|
int length = array.Length;
|
|
ISigner sig2 = this._sig;
|
|
int num2 = 0;
|
|
if (this._unsAttr != num2)
|
|
{
|
|
string text3 = this.outer.ToString();
|
|
CmsAttributeTableGenerator unsAttr = this._unsAttr;
|
|
CmsSignedDataStreamGenerator cmsSignedDataStreamGenerator2 = this.outer;
|
|
}
|
|
CmsSignedHelper helper2 = CmsSignedDataStreamGenerator.Helper;
|
|
DerObjectIdentifier derObjectIdentifier = new DerObjectIdentifier(this._encOID);
|
|
ISet noParams = CmsSignedHelper.noParams;
|
|
Asn1Encodable asn1Encodable;
|
|
AlgorithmIdentifier algorithmIdentifier = new AlgorithmIdentifier(derObjectIdentifier, asn1Encodable);
|
|
SignerInfo signerInfo;
|
|
return signerInfo;
|
|
}
|
|
|
|
// Token: 0x04007A95 RID: 31381
|
|
[FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x4007A95")]
|
|
private readonly CmsSignedDataStreamGenerator outer;
|
|
|
|
// Token: 0x04007A96 RID: 31382
|
|
[FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x4007A96")]
|
|
private readonly SignerIdentifier _signerIdentifier;
|
|
|
|
// Token: 0x04007A97 RID: 31383
|
|
[FieldOffset(Offset = "0x20")]
|
|
[Token(Token = "0x4007A97")]
|
|
private readonly string _digestOID;
|
|
|
|
// Token: 0x04007A98 RID: 31384
|
|
[FieldOffset(Offset = "0x28")]
|
|
[Token(Token = "0x4007A98")]
|
|
private readonly string _encOID;
|
|
|
|
// Token: 0x04007A99 RID: 31385
|
|
[FieldOffset(Offset = "0x30")]
|
|
[Token(Token = "0x4007A99")]
|
|
private readonly CmsAttributeTableGenerator _sAttr;
|
|
|
|
// Token: 0x04007A9A RID: 31386
|
|
[FieldOffset(Offset = "0x38")]
|
|
[Token(Token = "0x4007A9A")]
|
|
private readonly CmsAttributeTableGenerator _unsAttr;
|
|
|
|
// Token: 0x04007A9B RID: 31387
|
|
[FieldOffset(Offset = "0x40")]
|
|
[Token(Token = "0x4007A9B")]
|
|
private readonly string _encName;
|
|
|
|
// Token: 0x04007A9C RID: 31388
|
|
[FieldOffset(Offset = "0x48")]
|
|
[Token(Token = "0x4007A9C")]
|
|
private readonly ISigner _sig;
|
|
}
|
|
|
|
// Token: 0x02001E2B RID: 7723
|
|
[Token(Token = "0x2001E2B")]
|
|
private class CmsSignedDataOutputStream : BaseOutputStream
|
|
{
|
|
// Token: 0x0600C1C3 RID: 49603 RVA: 0x002BC40C File Offset: 0x002BA60C
|
|
[Token(Token = "0x600C1C3")]
|
|
[Address(RVA = "0x2921B50", Offset = "0x2920B50", VA = "0x182921B50")]
|
|
public CmsSignedDataOutputStream(CmsSignedDataStreamGenerator outer, Stream outStream, string contentOID, BerSequenceGenerator sGen, BerSequenceGenerator sigGen, BerSequenceGenerator eiGen)
|
|
{
|
|
this.outer = outer;
|
|
this._out = outStream;
|
|
DerObjectIdentifier derObjectIdentifier = new DerObjectIdentifier(contentOID);
|
|
this._sGen = 0;
|
|
this._sigGen = 0;
|
|
this._contentOID = derObjectIdentifier;
|
|
this._eiGen = 0;
|
|
}
|
|
|
|
// Token: 0x0600C1C4 RID: 49604 RVA: 0x002BC450 File Offset: 0x002BA650
|
|
[Token(Token = "0x600C1C4")]
|
|
[Address(RVA = "0x21448C0", Offset = "0x21438C0", VA = "0x1821448C0", Slot = "30")]
|
|
public override void WriteByte(byte b)
|
|
{
|
|
bool canRead = this._out.CanRead;
|
|
}
|
|
|
|
// Token: 0x0600C1C5 RID: 49605 RVA: 0x002BC470 File Offset: 0x002BA670
|
|
[Token(Token = "0x600C1C5")]
|
|
[Address(RVA = "0x21448F0", Offset = "0x21438F0", VA = "0x1821448F0", Slot = "29")]
|
|
public override void Write(byte[] bytes, int off, int len)
|
|
{
|
|
bool canRead = this._out.CanRead;
|
|
}
|
|
|
|
// Token: 0x0600C1C6 RID: 49606 RVA: 0x002BC490 File Offset: 0x002BA690
|
|
[Token(Token = "0x600C1C6")]
|
|
[Address(RVA = "0x2921060", Offset = "0x2920060", VA = "0x182921060", Slot = "15")]
|
|
public override void Close()
|
|
{
|
|
this.DoClose();
|
|
base.Close();
|
|
}
|
|
|
|
// Token: 0x0600C1C7 RID: 49607 RVA: 0x002BC4AC File Offset: 0x002BA6AC
|
|
[Token(Token = "0x600C1C7")]
|
|
[Address(RVA = "0x2921080", Offset = "0x2920080", VA = "0x182921080")]
|
|
private void DoClose()
|
|
{
|
|
int num5;
|
|
Asn1EncodableVector asn1EncodableVector;
|
|
Asn1Encodable[] array2;
|
|
AlgorithmIdentifier algorithmIdentifier;
|
|
for (;;)
|
|
{
|
|
int num = 0;
|
|
Platform.Dispose(this._out);
|
|
Stream rawOutputStream = this._eiGen.GetRawOutputStream();
|
|
IDictionary digests = this.outer._digests;
|
|
IList certs = this.outer._certs;
|
|
if (rawOutputStream > 0)
|
|
{
|
|
CmsSignedDataStreamGenerator cmsSignedDataStreamGenerator = this.outer;
|
|
Asn1Set asn1Set = CmsUtilities.CreateDerSetFromList(cmsSignedDataStreamGenerator._certs);
|
|
Asn1Set asn1Set2 = CmsUtilities.CreateBerSetFromList(cmsSignedDataStreamGenerator._certs);
|
|
BerSequenceGenerator sigGen = this._sigGen;
|
|
int num2;
|
|
int num3;
|
|
BerTaggedObject berTaggedObject = new BerTaggedObject(num2 != 0, num3, asn1Set2);
|
|
num3 = 0;
|
|
num2 = 0;
|
|
CmsSignedDataStreamGenerator.CmsSignedDataOutputStream.WriteToGenerator(sigGen, berTaggedObject);
|
|
}
|
|
CmsSignedDataStreamGenerator cmsSignedDataStreamGenerator2 = this.outer;
|
|
IList crls = cmsSignedDataStreamGenerator2._crls;
|
|
if (cmsSignedDataStreamGenerator2 > 0)
|
|
{
|
|
IList crls2 = this.outer._crls;
|
|
Asn1Set asn1Set3 = CmsUtilities.CreateDerSetFromList(crls2);
|
|
Asn1Set asn1Set4 = CmsUtilities.CreateBerSetFromList(crls2);
|
|
BerSequenceGenerator sigGen2 = this._sigGen;
|
|
int num4;
|
|
BerTaggedObject berTaggedObject2 = new BerTaggedObject(num4 != 0, 1, asn1Set4);
|
|
num4 = 0;
|
|
CmsSignedDataStreamGenerator.CmsSignedDataOutputStream.WriteToGenerator(sigGen2, berTaggedObject2);
|
|
}
|
|
CmsSignedDataStreamGenerator cmsSignedDataStreamGenerator3 = this.outer;
|
|
IDictionary messageDigests = cmsSignedDataStreamGenerator3._messageDigests;
|
|
if (cmsSignedDataStreamGenerator3 != 0)
|
|
{
|
|
IDictionary messageHashes = this.outer._messageHashes;
|
|
}
|
|
num5 = 0;
|
|
byte[] array;
|
|
if (array != 0)
|
|
{
|
|
}
|
|
if (num == 0)
|
|
{
|
|
if (num5 != -1)
|
|
{
|
|
}
|
|
IList signerInfs = this.outer._signerInfs;
|
|
if (asn1EncodableVector != 0)
|
|
{
|
|
break;
|
|
}
|
|
if (array2 != 0)
|
|
{
|
|
}
|
|
if (algorithmIdentifier == 0)
|
|
{
|
|
if (array2 == (ulong)(-1L) || "{il2cpp array field local64->}" == (ulong)511L)
|
|
{
|
|
}
|
|
CmsSignedDataStreamGenerator cmsSignedDataStreamGenerator4 = this.outer;
|
|
IList signers = cmsSignedDataStreamGenerator4._signers;
|
|
Asn1Encodable[] array3;
|
|
if (cmsSignedDataStreamGenerator4 != 0)
|
|
{
|
|
if (cmsSignedDataStreamGenerator4 == 0)
|
|
{
|
|
}
|
|
if (cmsSignedDataStreamGenerator4 == 0)
|
|
{
|
|
continue;
|
|
}
|
|
array3 = new Asn1Encodable[1];
|
|
IList crls3 = cmsSignedDataStreamGenerator4._crls;
|
|
if (crls3 != 0)
|
|
{
|
|
}
|
|
array3[0] = crls3;
|
|
asn1EncodableVector.Add(array3);
|
|
}
|
|
if (array3 != 0)
|
|
{
|
|
}
|
|
if (algorithmIdentifier == 0)
|
|
{
|
|
goto Block_9;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
DerObjectIdentifier derObjectIdentifier = new DerObjectIdentifier(num5);
|
|
DerNull instance = DerNull.Instance;
|
|
algorithmIdentifier = new AlgorithmIdentifier(derObjectIdentifier, instance);
|
|
IDictionary messageHashes2 = this.outer._messageHashes;
|
|
CmsSignedHelper helper = CmsSignedDataStreamGenerator.Helper;
|
|
IDictionary digests2 = this.outer._digests;
|
|
array2 = new Asn1Encodable[1];
|
|
IList v = asn1EncodableVector.v;
|
|
throw new ArrayTypeMismatchException();
|
|
Block_9:
|
|
BerSequenceGenerator sigGen3 = this._sigGen;
|
|
DerSet derSet = new DerSet(asn1EncodableVector);
|
|
CmsSignedDataStreamGenerator.CmsSignedDataOutputStream.WriteToGenerator(sigGen3, derSet);
|
|
Stream rawOutputStream2 = this._sigGen.GetRawOutputStream();
|
|
Stream rawOutputStream3 = this._sGen.GetRawOutputStream();
|
|
}
|
|
|
|
// Token: 0x0600C1C8 RID: 49608 RVA: 0x002BC6F4 File Offset: 0x002BA8F4
|
|
[Token(Token = "0x600C1C8")]
|
|
[Address(RVA = "0x2921AD0", Offset = "0x2920AD0", VA = "0x182921AD0")]
|
|
private static void WriteToGenerator(Asn1Generator ag, Asn1Encodable ae)
|
|
{
|
|
byte[] encoded = ae.GetEncoded();
|
|
}
|
|
|
|
// Token: 0x04007A9D RID: 31389
|
|
[FieldOffset(Offset = "0x30")]
|
|
[Token(Token = "0x4007A9D")]
|
|
private readonly CmsSignedDataStreamGenerator outer;
|
|
|
|
// Token: 0x04007A9E RID: 31390
|
|
[FieldOffset(Offset = "0x38")]
|
|
[Token(Token = "0x4007A9E")]
|
|
private Stream _out;
|
|
|
|
// Token: 0x04007A9F RID: 31391
|
|
[FieldOffset(Offset = "0x40")]
|
|
[Token(Token = "0x4007A9F")]
|
|
private DerObjectIdentifier _contentOID;
|
|
|
|
// Token: 0x04007AA0 RID: 31392
|
|
[FieldOffset(Offset = "0x48")]
|
|
[Token(Token = "0x4007AA0")]
|
|
private BerSequenceGenerator _sGen;
|
|
|
|
// Token: 0x04007AA1 RID: 31393
|
|
[FieldOffset(Offset = "0x50")]
|
|
[Token(Token = "0x4007AA1")]
|
|
private BerSequenceGenerator _sigGen;
|
|
|
|
// Token: 0x04007AA2 RID: 31394
|
|
[FieldOffset(Offset = "0x58")]
|
|
[Token(Token = "0x4007AA2")]
|
|
private BerSequenceGenerator _eiGen;
|
|
}
|
|
}
|
|
}
|