From 18c7d7e154c48b729ded47601c9b0ddd4f74650b Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Thu, 3 Nov 2022 18:59:52 +0700 Subject: Clenaup warnings --- crypto/src/cms/CMSAuthenticatedDataGenerator.cs | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'crypto/src/cms') diff --git a/crypto/src/cms/CMSAuthenticatedDataGenerator.cs b/crypto/src/cms/CMSAuthenticatedDataGenerator.cs index 6c68bccd1..f6827157c 100644 --- a/crypto/src/cms/CMSAuthenticatedDataGenerator.cs +++ b/crypto/src/cms/CMSAuthenticatedDataGenerator.cs @@ -62,9 +62,7 @@ namespace Org.BouncyCastle.Cms Asn1Encodable asn1Params = GenerateAsn1Parameters(macOid, encKeyBytes); - ICipherParameters cipherParameters; - macAlgId = GetAlgorithmIdentifier( - macOid, encKey, asn1Params, out cipherParameters); + macAlgId = GetAlgorithmIdentifier(macOid, encKey, asn1Params, out var cipherParameters); IMac mac = MacUtilities.GetMac(macOid); // TODO Confirm no ParametersWithRandom needed @@ -72,7 +70,7 @@ namespace Org.BouncyCastle.Cms // mac.Init(cipherParameters); mac.Init(encKey); - MemoryStream bOut = new MemoryStream(); + var bOut = new MemoryStream(); Stream mOut = new TeeOutputStream(bOut, new MacSink(mac)); content.Write(mOut); @@ -97,7 +95,7 @@ namespace Org.BouncyCastle.Cms throw new CmsException("exception decoding algorithm parameters.", e); } - Asn1EncodableVector recipientInfos = new Asn1EncodableVector(); + var recipientInfos = new Asn1EncodableVector(); foreach (RecipientInfoGenerator rig in recipientInfoGenerators) { @@ -115,11 +113,11 @@ namespace Org.BouncyCastle.Cms } } - ContentInfo eci = new ContentInfo(CmsObjectIdentifiers.Data, encContent); - - ContentInfo contentInfo = new ContentInfo( - CmsObjectIdentifiers.AuthenticatedData, - new AuthenticatedData(null, new DerSet(recipientInfos), macAlgId, null, eci, null, macResult, null)); + var eci = new ContentInfo(CmsObjectIdentifiers.Data, encContent); + + var contentInfo = new ContentInfo( + CmsObjectIdentifiers.AuthenticatedData, + new AuthenticatedData(null, new DerSet(recipientInfos), macAlgId, null, eci, null, macResult, null)); return new CmsAuthenticatedData(contentInfo); } -- cgit 1.4.1