948 lines
41 KiB
C#
948 lines
41 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.Crypto.IO;
|
|
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: 0x0200176B RID: 5995
|
|
[Token(Token = "0x200176B")]
|
|
[StructLayout(3)]
|
|
public class CmsSignedDataStreamGenerator : CmsSignedGenerator
|
|
{
|
|
// Token: 0x0600A1F7 RID: 41463 RVA: 0x0025ADFC File Offset: 0x00258FFC
|
|
[Token(Token = "0x600A1F7")]
|
|
[Address(RVA = "0x1C7FCE0", Offset = "0x1C7E6E0", VA = "0x181C7FCE0")]
|
|
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: 0x0600A1F8 RID: 41464 RVA: 0x0025AE58 File Offset: 0x00259058
|
|
[Token(Token = "0x600A1F8")]
|
|
[Address(RVA = "0x1C7FDD0", Offset = "0x1C7E7D0", VA = "0x181C7FDD0")]
|
|
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: 0x0600A1F9 RID: 41465 RVA: 0x0025AEAC File Offset: 0x002590AC
|
|
[Token(Token = "0x600A1F9")]
|
|
[Address(RVA = "0x568460", Offset = "0x566E60", VA = "0x180568460")]
|
|
public void SetBufferSize(int bufferSize)
|
|
{
|
|
this._bufferSize = bufferSize;
|
|
}
|
|
|
|
// Token: 0x0600A1FA RID: 41466 RVA: 0x0025AEC0 File Offset: 0x002590C0
|
|
[Token(Token = "0x600A1FA")]
|
|
[Address(RVA = "0x1C7DAF0", Offset = "0x1C7C4F0", VA = "0x181C7DAF0")]
|
|
public void AddDigests(params string[] digestOids)
|
|
{
|
|
this.AddDigests(digestOids);
|
|
}
|
|
|
|
// Token: 0x0600A1FB RID: 41467 RVA: 0x0025AED4 File Offset: 0x002590D4
|
|
[Token(Token = "0x600A1FB")]
|
|
[Address(RVA = "0x1C7DB00", Offset = "0x1C7C500", VA = "0x181C7DB00")]
|
|
public void AddDigests(IEnumerable digestOids)
|
|
{
|
|
int num;
|
|
do
|
|
{
|
|
num = 0;
|
|
num += num;
|
|
num++;
|
|
if (num != 0 && num == 0)
|
|
{
|
|
goto IL_33;
|
|
}
|
|
this.ConfigureDigest(num);
|
|
num += num;
|
|
num++;
|
|
num += 19;
|
|
if (num != 0)
|
|
{
|
|
}
|
|
if (num != -1)
|
|
{
|
|
}
|
|
}
|
|
while (num != 0);
|
|
return;
|
|
IL_33:
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0600A1FC RID: 41468 RVA: 0x0025AF1C File Offset: 0x0025911C
|
|
[Token(Token = "0x600A1FC")]
|
|
[Address(RVA = "0x1C7E290", Offset = "0x1C7CC90", VA = "0x181C7E290")]
|
|
public void AddSigner(AsymmetricKeyParameter privateKey, X509Certificate cert, string digestOid)
|
|
{
|
|
DefaultSignedAttributeTableGenerator defaultSignedAttributeTableGenerator = new DefaultSignedAttributeTableGenerator();
|
|
int num = 0;
|
|
this.AddSigner(privateKey, cert, digestOid, defaultSignedAttributeTableGenerator, num);
|
|
}
|
|
|
|
// Token: 0x0600A1FD RID: 41469 RVA: 0x0025AF3C File Offset: 0x0025913C
|
|
[Token(Token = "0x600A1FD")]
|
|
[Address(RVA = "0x1C7DD20", Offset = "0x1C7C720", VA = "0x181C7DD20")]
|
|
public void AddSigner(AsymmetricKeyParameter privateKey, X509Certificate cert, string encryptionOid, string digestOid)
|
|
{
|
|
DefaultSignedAttributeTableGenerator defaultSignedAttributeTableGenerator = new DefaultSignedAttributeTableGenerator();
|
|
SignerIdentifier signerIdentifier = CmsSignedGenerator.GetSignerIdentifier(cert);
|
|
}
|
|
|
|
// Token: 0x0600A1FE RID: 41470 RVA: 0x0025AF58 File Offset: 0x00259158
|
|
[Token(Token = "0x600A1FE")]
|
|
[Address(RVA = "0x1C7DEE0", Offset = "0x1C7C8E0", VA = "0x181C7DEE0")]
|
|
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)
|
|
{
|
|
}
|
|
|
|
// Token: 0x0600A1FF RID: 41471 RVA: 0x0025AF68 File Offset: 0x00259168
|
|
[Token(Token = "0x600A1FF")]
|
|
[Address(RVA = "0x1C7E1C0", Offset = "0x1C7CBC0", VA = "0x181C7E1C0")]
|
|
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)
|
|
{
|
|
}
|
|
|
|
// Token: 0x0600A200 RID: 41472 RVA: 0x0025AF78 File Offset: 0x00259178
|
|
[Token(Token = "0x600A200")]
|
|
[Address(RVA = "0x1C7DE10", Offset = "0x1C7C810", VA = "0x181C7DE10")]
|
|
public void AddSigner(AsymmetricKeyParameter privateKey, X509Certificate cert, string digestOid, CmsAttributeTableGenerator signedAttrGenerator, CmsAttributeTableGenerator unsignedAttrGenerator)
|
|
{
|
|
string encOid = CmsSignedDataStreamGenerator.Helper.GetEncOid(privateKey, digestOid);
|
|
}
|
|
|
|
// Token: 0x0600A201 RID: 41473 RVA: 0x0025AF98 File Offset: 0x00259198
|
|
[Token(Token = "0x600A201")]
|
|
[Address(RVA = "0x1C7E4F0", Offset = "0x1C7CEF0", VA = "0x181C7E4F0")]
|
|
public void AddSigner(AsymmetricKeyParameter privateKey, X509Certificate cert, string encryptionOid, string digestOid, CmsAttributeTableGenerator signedAttrGenerator, CmsAttributeTableGenerator unsignedAttrGenerator)
|
|
{
|
|
SignerIdentifier signerIdentifier = CmsSignedGenerator.GetSignerIdentifier(cert);
|
|
}
|
|
|
|
// Token: 0x0600A202 RID: 41474 RVA: 0x0025AFAC File Offset: 0x002591AC
|
|
[Token(Token = "0x600A202")]
|
|
[Address(RVA = "0x1C7E120", Offset = "0x1C7CB20", VA = "0x181C7E120")]
|
|
public void AddSigner(AsymmetricKeyParameter privateKey, byte[] subjectKeyID, string digestOid)
|
|
{
|
|
DefaultSignedAttributeTableGenerator defaultSignedAttributeTableGenerator = new DefaultSignedAttributeTableGenerator();
|
|
int num = 0;
|
|
this.AddSigner(privateKey, subjectKeyID, digestOid, defaultSignedAttributeTableGenerator, num);
|
|
}
|
|
|
|
// Token: 0x0600A203 RID: 41475 RVA: 0x0025AFCC File Offset: 0x002591CC
|
|
[Token(Token = "0x600A203")]
|
|
[Address(RVA = "0x1C7E330", Offset = "0x1C7CD30", VA = "0x181C7E330")]
|
|
public void AddSigner(AsymmetricKeyParameter privateKey, byte[] subjectKeyID, string encryptionOid, string digestOid)
|
|
{
|
|
DefaultSignedAttributeTableGenerator defaultSignedAttributeTableGenerator = new DefaultSignedAttributeTableGenerator();
|
|
SignerIdentifier signerIdentifier = CmsSignedGenerator.GetSignerIdentifier(subjectKeyID);
|
|
}
|
|
|
|
// Token: 0x0600A204 RID: 41476 RVA: 0x0025AFE8 File Offset: 0x002591E8
|
|
[Token(Token = "0x600A204")]
|
|
[Address(RVA = "0x1C7E050", Offset = "0x1C7CA50", VA = "0x181C7E050")]
|
|
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)
|
|
{
|
|
}
|
|
|
|
// Token: 0x0600A205 RID: 41477 RVA: 0x0025AFF8 File Offset: 0x002591F8
|
|
[Token(Token = "0x600A205")]
|
|
[Address(RVA = "0x1C7E420", Offset = "0x1C7CE20", VA = "0x181C7E420")]
|
|
public void AddSigner(AsymmetricKeyParameter privateKey, byte[] subjectKeyID, string digestOid, CmsAttributeTableGenerator signedAttrGenerator, CmsAttributeTableGenerator unsignedAttrGenerator)
|
|
{
|
|
string encOid = CmsSignedDataStreamGenerator.Helper.GetEncOid(privateKey, digestOid);
|
|
}
|
|
|
|
// Token: 0x0600A206 RID: 41478 RVA: 0x0025B018 File Offset: 0x00259218
|
|
[Token(Token = "0x600A206")]
|
|
[Address(RVA = "0x1C7DFB0", Offset = "0x1C7C9B0", VA = "0x181C7DFB0")]
|
|
public void AddSigner(AsymmetricKeyParameter privateKey, byte[] subjectKeyID, string encryptionOid, string digestOid, CmsAttributeTableGenerator signedAttrGenerator, CmsAttributeTableGenerator unsignedAttrGenerator)
|
|
{
|
|
SignerIdentifier signerIdentifier = CmsSignedGenerator.GetSignerIdentifier(subjectKeyID);
|
|
}
|
|
|
|
// Token: 0x0600A207 RID: 41479 RVA: 0x0025B02C File Offset: 0x0025922C
|
|
[Token(Token = "0x600A207")]
|
|
[Address(RVA = "0x1C7EFA0", Offset = "0x1C7D9A0", VA = "0x181C7EFA0")]
|
|
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: 0x0600A208 RID: 41480 RVA: 0x0025B054 File Offset: 0x00259254
|
|
[Token(Token = "0x600A208")]
|
|
[Address(RVA = "0x1C7DCD0", Offset = "0x1C7C6D0", VA = "0x181C7DCD0", Slot = "6")]
|
|
internal override void AddSignerCallback(SignerInformation si)
|
|
{
|
|
Asn1Object asn1Object = si.digestAlgorithm.ToAsn1Object();
|
|
}
|
|
|
|
// Token: 0x0600A209 RID: 41481 RVA: 0x0025B074 File Offset: 0x00259274
|
|
[Token(Token = "0x600A209")]
|
|
[Address(RVA = "0x1C7F420", Offset = "0x1C7DE20", VA = "0x181C7F420")]
|
|
public Stream Open(Stream outStream)
|
|
{
|
|
int num = 0;
|
|
int num2 = 0;
|
|
string data = CmsSignedGenerator.Data;
|
|
return this.Open(outStream, data, num2 != 0, num);
|
|
}
|
|
|
|
// Token: 0x0600A20A RID: 41482 RVA: 0x0025B098 File Offset: 0x00259298
|
|
[Token(Token = "0x600A20A")]
|
|
[Address(RVA = "0x1C7F380", Offset = "0x1C7DD80", VA = "0x181C7F380")]
|
|
public Stream Open(Stream outStream, bool encapsulate)
|
|
{
|
|
int num = 0;
|
|
string data = CmsSignedGenerator.Data;
|
|
return this.Open(outStream, data, encapsulate, num);
|
|
}
|
|
|
|
// Token: 0x0600A20B RID: 41483 RVA: 0x0025B0B8 File Offset: 0x002592B8
|
|
[Token(Token = "0x600A20B")]
|
|
[Address(RVA = "0x1C7F2E0", Offset = "0x1C7DCE0", VA = "0x181C7F2E0")]
|
|
public Stream Open(Stream outStream, bool encapsulate, Stream dataOutputStream)
|
|
{
|
|
string data = CmsSignedGenerator.Data;
|
|
return this.Open(outStream, data, encapsulate, dataOutputStream);
|
|
}
|
|
|
|
// Token: 0x0600A20C RID: 41484 RVA: 0x0025B0D8 File Offset: 0x002592D8
|
|
[Token(Token = "0x600A20C")]
|
|
[Address(RVA = "0x1C7FBA0", Offset = "0x1C7E5A0", VA = "0x181C7FBA0")]
|
|
public Stream Open(Stream outStream, string signedContentType, bool encapsulate)
|
|
{
|
|
int num = 0;
|
|
return this.Open(outStream, signedContentType, encapsulate, num);
|
|
}
|
|
|
|
// Token: 0x0600A20D RID: 41485 RVA: 0x0025B0F4 File Offset: 0x002592F4
|
|
[Token(Token = "0x600A20D")]
|
|
[Address(RVA = "0x1C7F4B0", Offset = "0x1C7DEB0", VA = "0x181C7F4B0")]
|
|
public Stream Open(Stream outStream, string signedContentType, bool encapsulate, Stream dataOutputStream)
|
|
{
|
|
int num;
|
|
Asn1EncodableVector asn1EncodableVector;
|
|
for (;;)
|
|
{
|
|
num = 0;
|
|
if (outStream == 0)
|
|
{
|
|
goto IL_127;
|
|
}
|
|
if (outStream.CanSeek)
|
|
{
|
|
if (outStream != 0 && !outStream.CanSeek)
|
|
{
|
|
goto IL_133;
|
|
}
|
|
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 != -1)
|
|
{
|
|
}
|
|
if (num == 0)
|
|
{
|
|
goto Block_5;
|
|
}
|
|
}
|
|
}
|
|
Asn1Encodable[] array;
|
|
DerNull instance;
|
|
if (asn1EncodableVector == 0 || asn1EncodableVector != 0)
|
|
{
|
|
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 = array.ToAsn1Object();
|
|
Asn1Object asn1Object2 = array.ToAsn1Object();
|
|
BerSequenceGenerator berSequenceGenerator2;
|
|
string text3 = berSequenceGenerator2.ToString();
|
|
int num2 = 0;
|
|
CmsSignedDataStreamGenerator.CmsSignedDataOutputStream cmsSignedDataOutputStream;
|
|
cmsSignedDataOutputStream.outer = instance;
|
|
Stream stream;
|
|
cmsSignedDataOutputStream._out = stream;
|
|
DerObjectIdentifier derObjectIdentifier3 = new DerObjectIdentifier(num2);
|
|
cmsSignedDataOutputStream._contentOID = derObjectIdentifier3;
|
|
cmsSignedDataOutputStream._sGen = derObjectIdentifier3;
|
|
cmsSignedDataOutputStream._sigGen = derObjectIdentifier3;
|
|
cmsSignedDataOutputStream._eiGen = berSequenceGenerator2;
|
|
IL_127:
|
|
ArgumentNullException ex2 = new ArgumentNullException("outStream");
|
|
IL_133:
|
|
ArgumentException ex3 = new ArgumentException("Expected writeable stream", "dataOutputStream");
|
|
throw new IndexOutOfRangeException();
|
|
}
|
|
|
|
// Token: 0x0600A20E RID: 41486 RVA: 0x0025B25C File Offset: 0x0025945C
|
|
[Token(Token = "0x600A20E")]
|
|
[Address(RVA = "0x1C7FBC0", Offset = "0x1C7E5C0", VA = "0x181C7FBC0")]
|
|
private void RegisterDigestOid(string digestOid)
|
|
{
|
|
ISet messageDigestOids = this._messageDigestOids;
|
|
if (!this._messageDigestsLocked)
|
|
{
|
|
return;
|
|
}
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0600A20F RID: 41487 RVA: 0x0025B28C File Offset: 0x0025948C
|
|
[Token(Token = "0x600A20F")]
|
|
[Address(RVA = "0x1C7EE00", Offset = "0x1C7D800", VA = "0x181C7EE00")]
|
|
private void ConfigureDigest(string digestOid)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600A20F)
|
|
|
|
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: 0x0600A210 RID: 41488 RVA: 0x0025B2EC File Offset: 0x002594EC
|
|
[Token(Token = "0x600A210")]
|
|
[Address(RVA = "0x1C7F0B0", Offset = "0x1C7DAB0", VA = "0x181C7F0B0")]
|
|
internal void Generate(Stream outStream, string eContentType, bool encapsulate, Stream dataOutputStream, CmsProcessable content)
|
|
{
|
|
Stream stream;
|
|
Platform.Dispose(stream);
|
|
}
|
|
|
|
// Token: 0x0600A211 RID: 41489 RVA: 0x0025B300 File Offset: 0x00259500
|
|
[Token(Token = "0x600A211")]
|
|
[Address(RVA = "0x1C7E770", Offset = "0x1C7D170", VA = "0x181C7E770")]
|
|
private DerInteger CalculateVersion(DerObjectIdentifier contentOid)
|
|
{
|
|
for (;;)
|
|
{
|
|
int num = 0;
|
|
if (this._certs == 0)
|
|
{
|
|
goto IL_19;
|
|
}
|
|
if (num != -1)
|
|
{
|
|
if ((ulong)1L == 0UL)
|
|
{
|
|
goto IL_19;
|
|
}
|
|
goto IL_67;
|
|
}
|
|
IL_22:
|
|
if (num != 0)
|
|
{
|
|
continue;
|
|
}
|
|
if ((uint)(-1) != 0U)
|
|
{
|
|
}
|
|
if ((ulong)((uint)(-1)) != (ulong)(-1L))
|
|
{
|
|
}
|
|
if (num == 0)
|
|
{
|
|
break;
|
|
}
|
|
continue;
|
|
IL_19:
|
|
if (this._crls != 0)
|
|
{
|
|
goto IL_22;
|
|
}
|
|
break;
|
|
}
|
|
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_67:
|
|
return new DerInteger(5);
|
|
}
|
|
|
|
// Token: 0x0600A212 RID: 41490 RVA: 0x0025B388 File Offset: 0x00259588
|
|
[Token(Token = "0x600A212")]
|
|
[Address(RVA = "0x1C7EBA0", Offset = "0x1C7D5A0", VA = "0x181C7EBA0")]
|
|
private bool CheckForVersion3(IList signerInfos)
|
|
{
|
|
for (;;)
|
|
{
|
|
int num = 0;
|
|
SignerInfo signerInfo;
|
|
int intValue = signerInfo.version.Value.IntValue;
|
|
while (intValue != 3)
|
|
{
|
|
}
|
|
if (intValue != 0)
|
|
{
|
|
}
|
|
if (num != -1)
|
|
{
|
|
if (typeof(IDisposable).TypeHandle == (ulong)81L)
|
|
{
|
|
break;
|
|
}
|
|
if (typeof(IDisposable).TypeHandle == (ulong)79L)
|
|
{
|
|
goto IL_42;
|
|
}
|
|
}
|
|
if (num == 0)
|
|
{
|
|
goto IL_42;
|
|
}
|
|
}
|
|
return true;
|
|
IL_42:
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0600A213 RID: 41491 RVA: 0x0025B400 File Offset: 0x00259600
|
|
[Token(Token = "0x600A213")]
|
|
[Address(RVA = "0x1C7E590", Offset = "0x1C7CF90", VA = "0x181C7E590")]
|
|
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)
|
|
{
|
|
}
|
|
if (num != -1)
|
|
{
|
|
}
|
|
}
|
|
while (num != 0);
|
|
return safeTeeOutputStream;
|
|
}
|
|
|
|
// Token: 0x0600A214 RID: 41492 RVA: 0x0025B430 File Offset: 0x00259630
|
|
[Token(Token = "0x600A214")]
|
|
[Address(RVA = "0x1C7F170", Offset = "0x1C7DB70", VA = "0x181C7F170")]
|
|
private static Stream GetSafeOutputStream(Stream s)
|
|
{
|
|
if (s == 0)
|
|
{
|
|
NullOutputStream nullOutputStream = new NullOutputStream();
|
|
}
|
|
return s;
|
|
}
|
|
|
|
// Token: 0x0600A215 RID: 41493 RVA: 0x0025B448 File Offset: 0x00259648
|
|
[Token(Token = "0x600A215")]
|
|
[Address(RVA = "0x1C7F1C0", Offset = "0x1C7DBC0", VA = "0x181C7F1C0")]
|
|
private static Stream GetSafeTeeOutputStream(Stream s1, Stream s2)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600A215)
|
|
|
|
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: 0x04006A90 RID: 27280
|
|
[Token(Token = "0x4006A90")]
|
|
private static readonly CmsSignedHelper Helper = CmsSignedHelper.Instance;
|
|
|
|
// Token: 0x04006A91 RID: 27281
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x40")]
|
|
[Token(Token = "0x4006A91")]
|
|
private readonly IList _signerInfs;
|
|
|
|
// Token: 0x04006A92 RID: 27282
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x48")]
|
|
[Token(Token = "0x4006A92")]
|
|
private readonly ISet _messageDigestOids;
|
|
|
|
// Token: 0x04006A93 RID: 27283
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x50")]
|
|
[Token(Token = "0x4006A93")]
|
|
private readonly IDictionary _messageDigests;
|
|
|
|
// Token: 0x04006A94 RID: 27284
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x58")]
|
|
[Token(Token = "0x4006A94")]
|
|
private readonly IDictionary _messageHashes;
|
|
|
|
// Token: 0x04006A95 RID: 27285
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x60")]
|
|
[Token(Token = "0x4006A95")]
|
|
private bool _messageDigestsLocked;
|
|
|
|
// Token: 0x04006A96 RID: 27286
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x64")]
|
|
[Token(Token = "0x4006A96")]
|
|
private int _bufferSize;
|
|
|
|
// Token: 0x0200176C RID: 5996
|
|
[Token(Token = "0x200176C")]
|
|
private class DigestAndSignerInfoGeneratorHolder
|
|
{
|
|
// Token: 0x0600A217 RID: 41495 RVA: 0x0025B488 File Offset: 0x00259688
|
|
[Token(Token = "0x600A217")]
|
|
[Address(RVA = "0x3C39C0", Offset = "0x3C23C0", VA = "0x1803C39C0")]
|
|
internal DigestAndSignerInfoGeneratorHolder(ISignerInfoGenerator signerInf, string digestOID)
|
|
{
|
|
this.signerInf = signerInf;
|
|
this.digestOID = digestOID;
|
|
}
|
|
|
|
// Token: 0x1700196B RID: 6507
|
|
// (get) Token: 0x0600A218 RID: 41496 RVA: 0x0025B4AC File Offset: 0x002596AC
|
|
[Token(Token = "0x1700196B")]
|
|
internal AlgorithmIdentifier DigestAlgorithm
|
|
{
|
|
[Token(Token = "0x600A218")]
|
|
[Address(RVA = "0x1C863E0", Offset = "0x1C84DE0", VA = "0x181C863E0")]
|
|
get
|
|
{
|
|
DerObjectIdentifier derObjectIdentifier = new DerObjectIdentifier(this.digestOID);
|
|
DerNull instance = DerNull.Instance;
|
|
return new AlgorithmIdentifier(derObjectIdentifier, instance);
|
|
}
|
|
}
|
|
|
|
// Token: 0x04006A97 RID: 27287
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x4006A97")]
|
|
internal readonly ISignerInfoGenerator signerInf;
|
|
|
|
// Token: 0x04006A98 RID: 27288
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x4006A98")]
|
|
internal readonly string digestOID;
|
|
}
|
|
|
|
// Token: 0x0200176D RID: 5997
|
|
[Token(Token = "0x200176D")]
|
|
private class SignerInfoGeneratorImpl : ISignerInfoGenerator
|
|
{
|
|
// Token: 0x0600A219 RID: 41497 RVA: 0x0025B4D4 File Offset: 0x002596D4
|
|
[Token(Token = "0x600A219")]
|
|
[Address(RVA = "0x1C87650", Offset = "0x1C86050", VA = "0x181C87650")]
|
|
internal SignerInfoGeneratorImpl(CmsSignedDataStreamGenerator outer, AsymmetricKeyParameter key, SignerIdentifier signerIdentifier, string digestOID, string encOID, CmsAttributeTableGenerator sAttr, CmsAttributeTableGenerator unsAttr)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600A219)
|
|
|
|
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: 0x0600A21A RID: 41498 RVA: 0x0025B5CC File Offset: 0x002597CC
|
|
[Token(Token = "0x600A21A")]
|
|
[Address(RVA = "0x1C87050", Offset = "0x1C85A50", VA = "0x181C87050", 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_9B;
|
|
}
|
|
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;
|
|
int num2 = 0;
|
|
IL_9B:
|
|
ISigner sig = this._sig;
|
|
if (num < num2)
|
|
{
|
|
num += num;
|
|
num++;
|
|
}
|
|
ISigner sig2 = this._sig;
|
|
if (this._unsAttr != num)
|
|
{
|
|
string text3 = this.outer.ToString();
|
|
CmsAttributeTableGenerator unsAttr = this._unsAttr;
|
|
CmsSignedDataStreamGenerator cmsSignedDataStreamGenerator2 = this.outer;
|
|
}
|
|
CmsSignedHelper helper2 = CmsSignedDataStreamGenerator.Helper;
|
|
DerObjectIdentifier derObjectIdentifier = new DerObjectIdentifier(this._encOID);
|
|
Asn1Encodable asn1Encodable;
|
|
AlgorithmIdentifier encAlgorithmIdentifier = helper2.GetEncAlgorithmIdentifier(derObjectIdentifier, asn1Encodable);
|
|
SignerIdentifier signerIdentifier = this._signerIdentifier;
|
|
SignerInfo signerInfo;
|
|
return signerInfo;
|
|
}
|
|
|
|
// Token: 0x04006A99 RID: 27289
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x4006A99")]
|
|
private readonly CmsSignedDataStreamGenerator outer;
|
|
|
|
// Token: 0x04006A9A RID: 27290
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x4006A9A")]
|
|
private readonly SignerIdentifier _signerIdentifier;
|
|
|
|
// Token: 0x04006A9B RID: 27291
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
|
|
[Token(Token = "0x4006A9B")]
|
|
private readonly string _digestOID;
|
|
|
|
// Token: 0x04006A9C RID: 27292
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
|
|
[Token(Token = "0x4006A9C")]
|
|
private readonly string _encOID;
|
|
|
|
// Token: 0x04006A9D RID: 27293
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
|
|
[Token(Token = "0x4006A9D")]
|
|
private readonly CmsAttributeTableGenerator _sAttr;
|
|
|
|
// Token: 0x04006A9E RID: 27294
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x38")]
|
|
[Token(Token = "0x4006A9E")]
|
|
private readonly CmsAttributeTableGenerator _unsAttr;
|
|
|
|
// Token: 0x04006A9F RID: 27295
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x40")]
|
|
[Token(Token = "0x4006A9F")]
|
|
private readonly string _encName;
|
|
|
|
// Token: 0x04006AA0 RID: 27296
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x48")]
|
|
[Token(Token = "0x4006AA0")]
|
|
private readonly ISigner _sig;
|
|
}
|
|
|
|
// Token: 0x0200176E RID: 5998
|
|
[Token(Token = "0x200176E")]
|
|
private class CmsSignedDataOutputStream : BaseOutputStream
|
|
{
|
|
// Token: 0x0600A21B RID: 41499 RVA: 0x0025B778 File Offset: 0x00259978
|
|
[Token(Token = "0x600A21B")]
|
|
[Address(RVA = "0x1C7C3A0", Offset = "0x1C7ADA0", VA = "0x181C7C3A0")]
|
|
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: 0x0600A21C RID: 41500 RVA: 0x0025B7BC File Offset: 0x002599BC
|
|
[Token(Token = "0x600A21C")]
|
|
[Address(RVA = "0x1C75AC0", Offset = "0x1C744C0", VA = "0x181C75AC0", Slot = "30")]
|
|
public override void WriteByte(byte b)
|
|
{
|
|
bool canRead = this._out.CanRead;
|
|
}
|
|
|
|
// Token: 0x0600A21D RID: 41501 RVA: 0x0025B7DC File Offset: 0x002599DC
|
|
[Token(Token = "0x600A21D")]
|
|
[Address(RVA = "0x1C75AF0", Offset = "0x1C744F0", VA = "0x181C75AF0", Slot = "29")]
|
|
public override void Write(byte[] bytes, int off, int len)
|
|
{
|
|
bool canRead = this._out.CanRead;
|
|
}
|
|
|
|
// Token: 0x0600A21E RID: 41502 RVA: 0x0025B7FC File Offset: 0x002599FC
|
|
[Token(Token = "0x600A21E")]
|
|
[Address(RVA = "0x1C7B840", Offset = "0x1C7A240", VA = "0x181C7B840", Slot = "15")]
|
|
public override void Close()
|
|
{
|
|
this.DoClose();
|
|
base.Close();
|
|
}
|
|
|
|
// Token: 0x0600A21F RID: 41503 RVA: 0x0025B818 File Offset: 0x00259A18
|
|
[Token(Token = "0x600A21F")]
|
|
[Address(RVA = "0x1C7B860", Offset = "0x1C7A260", VA = "0x181C7B860")]
|
|
private void DoClose()
|
|
{
|
|
int num4;
|
|
Asn1EncodableVector asn1EncodableVector;
|
|
Asn1Encodable[] array2;
|
|
Asn1Encodable[] array3;
|
|
for (;;)
|
|
{
|
|
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);
|
|
int num;
|
|
int num2;
|
|
BerTaggedObject berTaggedObject = new BerTaggedObject(num != 0, num2, asn1Set2);
|
|
num2 = 0;
|
|
num = 0;
|
|
}
|
|
CmsSignedDataStreamGenerator cmsSignedDataStreamGenerator2 = this.outer;
|
|
IList crls = cmsSignedDataStreamGenerator2._crls;
|
|
BerTaggedObject berTaggedObject2;
|
|
if (cmsSignedDataStreamGenerator2 > 0)
|
|
{
|
|
IList crls2 = this.outer._crls;
|
|
Asn1Set asn1Set3 = CmsUtilities.CreateDerSetFromList(crls2);
|
|
Asn1Set asn1Set4 = CmsUtilities.CreateBerSetFromList(crls2);
|
|
int num3;
|
|
berTaggedObject2 = new BerTaggedObject(num3 != 0, 1, asn1Set4);
|
|
num3 = 0;
|
|
}
|
|
if (berTaggedObject2 != 0)
|
|
{
|
|
}
|
|
num4 = 0;
|
|
byte[] array;
|
|
if (array != 0)
|
|
{
|
|
}
|
|
if (num4 != -1)
|
|
{
|
|
if (asn1EncodableVector != 0)
|
|
{
|
|
break;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (asn1EncodableVector != 0)
|
|
{
|
|
continue;
|
|
}
|
|
array2[0] = array2;
|
|
}
|
|
num4++;
|
|
if (num4 != 0)
|
|
{
|
|
}
|
|
if (num4 != -1 && "{il2cpp array field local55->}" == (ulong)511L)
|
|
{
|
|
if (num4 == 0)
|
|
{
|
|
goto IL_169;
|
|
}
|
|
if (num4 != 0)
|
|
{
|
|
goto IL_147;
|
|
}
|
|
}
|
|
if (asn1EncodableVector != 0)
|
|
{
|
|
continue;
|
|
}
|
|
IL_147:
|
|
if (num4 == 0)
|
|
{
|
|
continue;
|
|
}
|
|
array3 = new Asn1Encodable[1];
|
|
if (num4 != 0)
|
|
{
|
|
}
|
|
array3[0] = num4;
|
|
IL_169:
|
|
num4++;
|
|
if (num4 != 0)
|
|
{
|
|
}
|
|
if ((num4 != -1 && "{il2cpp array field local66->}" == (ulong)599L) || asn1EncodableVector == 0)
|
|
{
|
|
goto IL_18F;
|
|
}
|
|
}
|
|
DerObjectIdentifier derObjectIdentifier = new DerObjectIdentifier(num4);
|
|
DerNull instance = DerNull.Instance;
|
|
AlgorithmIdentifier algorithmIdentifier = new AlgorithmIdentifier(derObjectIdentifier, instance);
|
|
CmsSignedHelper helper = CmsSignedDataStreamGenerator.Helper;
|
|
array2 = new Asn1Encodable[1];
|
|
IList v = asn1EncodableVector.v;
|
|
throw new ArrayTypeMismatchException();
|
|
IL_18F:
|
|
Asn1Object asn1Object = array3.ToAsn1Object();
|
|
Asn1Object asn1Object2 = array3.ToAsn1Object();
|
|
}
|
|
|
|
// Token: 0x0600A220 RID: 41504 RVA: 0x0025B9CC File Offset: 0x00259BCC
|
|
[Token(Token = "0x600A220")]
|
|
[Address(RVA = "0x1C7C320", Offset = "0x1C7AD20", VA = "0x181C7C320")]
|
|
private static void WriteToGenerator(Asn1Generator ag, Asn1Encodable ae)
|
|
{
|
|
byte[] encoded = ae.GetEncoded();
|
|
}
|
|
|
|
// Token: 0x04006AA1 RID: 27297
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
|
|
[Token(Token = "0x4006AA1")]
|
|
private readonly CmsSignedDataStreamGenerator outer;
|
|
|
|
// Token: 0x04006AA2 RID: 27298
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x38")]
|
|
[Token(Token = "0x4006AA2")]
|
|
private Stream _out;
|
|
|
|
// Token: 0x04006AA3 RID: 27299
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x40")]
|
|
[Token(Token = "0x4006AA3")]
|
|
private DerObjectIdentifier _contentOID;
|
|
|
|
// Token: 0x04006AA4 RID: 27300
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x48")]
|
|
[Token(Token = "0x4006AA4")]
|
|
private BerSequenceGenerator _sGen;
|
|
|
|
// Token: 0x04006AA5 RID: 27301
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x50")]
|
|
[Token(Token = "0x4006AA5")]
|
|
private BerSequenceGenerator _sigGen;
|
|
|
|
// Token: 0x04006AA6 RID: 27302
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x58")]
|
|
[Token(Token = "0x4006AA6")]
|
|
private BerSequenceGenerator _eiGen;
|
|
}
|
|
}
|
|
}
|