MalwareSourceCode/MSIL/Virus/Win32/E/Virus.Win32.Expiro.w-f8f9f26e940480624825f6bddbea86e70fc4aa746c4dd8efa7d98dcb477000ed/Microsoft/InfoCards/GetPolicyDetailsRequest.cs

107 lines
3.8 KiB
C#
Raw Normal View History

2022-08-18 11:28:56 +00:00
// Decompiled with JetBrains decompiler
// Type: Microsoft.InfoCards.GetPolicyDetailsRequest
// Assembly: infocard, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
// MVID: 1D4D5564-A025-490C-AF1D-DF4FBB709D1F
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare-00001-msil\Virus.Win32.Expiro.w-f8f9f26e940480624825f6bddbea86e70fc4aa746c4dd8efa7d98dcb477000ed.exe
using Microsoft.InfoCards.Diagnostics;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
namespace Microsoft.InfoCards
{
internal class GetPolicyDetailsRequest : UIAgentRequest
{
private InfoCardPolicy m_policy;
private Recipient m_recipient;
private string m_privacyPolicyLink = string.Empty;
public GetPolicyDetailsRequest(
IntPtr rpcHandle,
Stream inArgs,
Stream outArgs,
ClientUIRequest parent)
: base(rpcHandle, inArgs, outArgs, parent)
{
}
protected override void OnInitializeAsSystem()
{
base.OnInitializeAsSystem();
this.m_policy = this.GetPolicy();
}
protected override void OnMarshalInArgs()
{
}
protected override void OnProcess()
{
InfoCardTrace.Assert(null != this.m_policy, "Null policy");
StoreConnection connection = StoreConnection.GetConnection();
try
{
DataRow singleRow = connection.GetSingleRow(new List<QueryParameter>()
{
new QueryParameter("ix_objecttype", new object[1]
{
(object) -3
}),
new QueryParameter("ix_name", new object[1]
{
(object) this.m_policy.Recipient.GetIdentifier()
})
}.ToArray());
if (this.m_policy.Recipient is X509RecipientIdentity recipient)
this.ParentRequest.CertCacheAdd(this.m_policy.Recipient.GetIdentifier(), recipient.LeafCertificate);
if (singleRow != null)
{
this.m_recipient = new Recipient((Stream) new MemoryStream(singleRow.GetDataField()), this.m_policy.Recipient, true);
if (this.m_recipient.Trust == Recipient.TrustDecision.IsTrusted && (int) this.m_recipient.PrivacyPolicyVersion != (int) this.m_policy.PrivacyPolicyVersion)
this.m_recipient.Trust = Recipient.TrustDecision.PolicyVersionChange;
this.m_recipient.PrivacyPolicyVersion = this.m_policy.PrivacyPolicyVersion;
}
else
{
this.m_recipient = new Recipient(this.m_policy.Recipient, true, this.m_policy.PrivacyPolicyVersion);
this.m_recipient.Trust = Recipient.TrustDecision.NoTrustDecision;
}
this.m_privacyPolicyLink = this.m_policy.PrivacyPolicyLink;
}
finally
{
connection.Close();
}
}
protected override void OnMarshalOutArgs()
{
InfoCardTrace.Assert(null != this.m_policy, "Null policy");
BinaryWriter writer = new BinaryWriter(this.OutArgs, Encoding.Unicode);
writer.Write(this.m_policy.RequiresManagedCard);
writer.Write(this.m_policy.RequiresSelfIssuedCard);
writer.Write(this.ParentRequest is GetBrowserTokenRequest);
this.m_recipient.Serialize(writer);
Utility.SerializeString(writer, this.m_privacyPolicyLink);
if (this.m_policy.RequiredClaims != null)
{
writer.Write(this.m_policy.RequiredClaims.Length);
for (int index = 0; index < this.m_policy.RequiredClaims.Length; ++index)
Utility.SerializeString(writer, this.m_policy.RequiredClaims[index]);
}
else
writer.Write(0);
if (this.m_policy.OptionalClaims != null)
{
writer.Write(this.m_policy.OptionalClaims.Length);
for (int index = 0; index < this.m_policy.OptionalClaims.Length; ++index)
Utility.SerializeString(writer, this.m_policy.OptionalClaims[index]);
}
else
writer.Write(0);
}
}
}