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

163 lines
7.7 KiB
C#

using System;
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.Parameters;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001747 RID: 5959
[Token(Token = "0x2001747")]
[StructLayout(3)]
internal class CmsAuthEnvelopedData
{
// Token: 0x0600A10B RID: 41227 RVA: 0x002573D4 File Offset: 0x002555D4
[Token(Token = "0x600A10B")]
[Address(RVA = "0x1C71390", Offset = "0x1C6FD90", VA = "0x181C71390")]
public CmsAuthEnvelopedData(byte[] authEnvData)
{
ContentInfo contentInfo = CmsUtilities.ReadContentInfo(new Asn1InputStream(authEnvData));
}
// Token: 0x0600A10C RID: 41228 RVA: 0x002573F0 File Offset: 0x002555F0
[Token(Token = "0x600A10C")]
[Address(RVA = "0x1C71410", Offset = "0x1C6FE10", VA = "0x181C71410")]
public CmsAuthEnvelopedData(Stream authEnvData)
{
ContentInfo contentInfo = CmsUtilities.ReadContentInfo(new Asn1InputStream(authEnvData, int.MaxValue));
}
// Token: 0x0600A10D RID: 41229 RVA: 0x00257410 File Offset: 0x00255610
[Token(Token = "0x600A10D")]
[Address(RVA = "0x1C71490", Offset = "0x1C6FE90", VA = "0x181C71490")]
public CmsAuthEnvelopedData(ContentInfo contentInfo)
{
this.contentInfo = contentInfo;
AuthEnvelopedData instance = AuthEnvelopedData.GetInstance(contentInfo.content);
OriginatorInfo originatorInfo = instance.originatorInfo;
this.originator = originatorInfo;
EncryptedContentInfo authEncryptedContentInfo = instance.authEncryptedContentInfo;
Asn1Set recipientInfos = instance.recipientInfos;
AlgorithmIdentifier contentEncryptionAlgorithm = authEncryptedContentInfo.contentEncryptionAlgorithm;
this.authEncAlg = contentEncryptionAlgorithm;
CmsAuthEnvelopedData.AuthEnvelopedSecureReadable authEnvelopedSecureReadable;
authEnvelopedSecureReadable.parent = this;
RecipientInformationStore recipientInformationStore = CmsEnvelopedHelper.BuildRecipientInformationStore(recipientInfos, authEnvelopedSecureReadable);
this.recipientInfoStore = recipientInformationStore;
Asn1Set asn1Set = instance.authAttrs;
this.authAttrs = asn1Set;
Stream octetStream = instance.mac.GetOctetStream();
this.mac = octetStream;
Asn1Set asn1Set2 = instance.unauthAttrs;
this.unauthAttrs = asn1Set2;
}
// Token: 0x04006A06 RID: 27142
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006A06")]
internal RecipientInformationStore recipientInfoStore;
// Token: 0x04006A07 RID: 27143
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x4006A07")]
internal ContentInfo contentInfo;
// Token: 0x04006A08 RID: 27144
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
[Token(Token = "0x4006A08")]
private OriginatorInfo originator;
// Token: 0x04006A09 RID: 27145
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
[Token(Token = "0x4006A09")]
private AlgorithmIdentifier authEncAlg;
// Token: 0x04006A0A RID: 27146
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
[Token(Token = "0x4006A0A")]
private Asn1Set authAttrs;
// Token: 0x04006A0B RID: 27147
[global::Cpp2IlInjected.FieldOffset(Offset = "0x38")]
[Token(Token = "0x4006A0B")]
private byte[] mac;
// Token: 0x04006A0C RID: 27148
[global::Cpp2IlInjected.FieldOffset(Offset = "0x40")]
[Token(Token = "0x4006A0C")]
private Asn1Set unauthAttrs;
// Token: 0x02001748 RID: 5960
[Token(Token = "0x2001748")]
private class AuthEnvelopedSecureReadable : CmsSecureReadable
{
// Token: 0x0600A10E RID: 41230 RVA: 0x002574B8 File Offset: 0x002556B8
[Token(Token = "0x600A10E")]
[Address(RVA = "0x3C3A30", Offset = "0x3C2430", VA = "0x1803C3A30")]
internal AuthEnvelopedSecureReadable(CmsAuthEnvelopedData parent)
{
this.parent = parent;
}
// Token: 0x17001944 RID: 6468
// (get) Token: 0x0600A10F RID: 41231 RVA: 0x002574D4 File Offset: 0x002556D4
[Token(Token = "0x17001944")]
public AlgorithmIdentifier Algorithm
{
[Token(Token = "0x600A10F")]
[Address(RVA = "0x550740", Offset = "0x54F140", VA = "0x180550740", Slot = "4")]
get
{
return this.parent.authEncAlg;
}
}
// Token: 0x17001945 RID: 6469
// (get) Token: 0x0600A110 RID: 41232 RVA: 0x002574F4 File Offset: 0x002556F4
[Token(Token = "0x17001945")]
public object CryptoObject
{
[Token(Token = "0x600A110")]
[Address(RVA = "0x3F8880", Offset = "0x3F7280", VA = "0x1803F8880", Slot = "5")]
get
{
}
}
// Token: 0x0600A111 RID: 41233 RVA: 0x00257504 File Offset: 0x00255704
[Token(Token = "0x600A111")]
[Address(RVA = "0x1C71180", Offset = "0x1C6FB80", VA = "0x181C71180", Slot = "6")]
public CmsReadable GetReadable(KeyParameter key)
{
/*
An exception occurred when decompiling this method (0600A111)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsReadable BestHTTP.SecureProtocol.Org.BouncyCastle.Cms.CmsAuthEnvelopedData/AuthEnvelopedSecureReadable::GetReadable(BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters.KeyParameter)
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_0:
stloc:CmsException(var_0_0A, newobj:CmsException(CmsException::.ctor, ldstr:string("AuthEnveloped data decryption not yet implemented")))
}
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: 0x04006A0D RID: 27149
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006A0D")]
private readonly CmsAuthEnvelopedData parent;
}
}
}