From 7610f647360313aa86d89884c45ce6d334876b73 Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Sat, 4 Feb 2023 02:17:04 +0700 Subject: Misc. refactoring after bc-fips-csharp updates --- crypto/src/cmp/ProtectedPkiMessage.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'crypto/src/cmp') diff --git a/crypto/src/cmp/ProtectedPkiMessage.cs b/crypto/src/cmp/ProtectedPkiMessage.cs index 8bc9e4f4d..fdcdeb90d 100644 --- a/crypto/src/cmp/ProtectedPkiMessage.cs +++ b/crypto/src/cmp/ProtectedPkiMessage.cs @@ -111,10 +111,11 @@ namespace Org.BouncyCastle.Cmp throw new InvalidOperationException("protection algorithm is not mac based"); PbmParameter parameter = PbmParameter.GetInstance(m_pkiMessage.Header.ProtectionAlg.Parameters); - pkMacBuilder.SetParameters(parameter); - IBlockResult result = Process(pkMacBuilder.Build(password).CreateCalculator()); + var macFactory = pkMacBuilder.Build(password); + + IBlockResult result = Process(macFactory.CreateCalculator()); return Arrays.FixedTimeEquals(result.Collect(), m_pkiMessage.Protection.GetBytes()); } @@ -126,10 +127,11 @@ namespace Org.BouncyCastle.Cmp throw new InvalidOperationException("protection algorithm is not mac based"); PbmParameter parameter = PbmParameter.GetInstance(m_pkiMessage.Header.ProtectionAlg.Parameters); - pkMacBuilder.SetParameters(parameter); - IBlockResult result = Process(pkMacBuilder.Build(password).CreateCalculator()); + var macFactory = pkMacBuilder.Build(password); + + IBlockResult result = Process(macFactory.CreateCalculator()); return Arrays.FixedTimeEquals(result.Collect(), m_pkiMessage.Protection.GetBytes()); } -- cgit 1.4.1