summary refs log tree commit diff
path: root/crypto/src/cms
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2022-11-03 18:59:52 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2022-11-03 18:59:52 +0700
commit18c7d7e154c48b729ded47601c9b0ddd4f74650b (patch)
tree30e0d05f017ce07e4705e7a7257e505ef27f445f /crypto/src/cms
parentEmbedAllSources, remove SourceLink (diff)
downloadBouncyCastle.NET-ed25519-18c7d7e154c48b729ded47601c9b0ddd4f74650b.tar.xz
Clenaup warnings
Diffstat (limited to 'crypto/src/cms')
-rw-r--r--crypto/src/cms/CMSAuthenticatedDataGenerator.cs18
1 files changed, 8 insertions, 10 deletions
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);
 		}