diff options
Diffstat (limited to 'crypto/test/src/cms/test/MiscDataStreamTest.cs')
-rw-r--r-- | crypto/test/src/cms/test/MiscDataStreamTest.cs | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/crypto/test/src/cms/test/MiscDataStreamTest.cs b/crypto/test/src/cms/test/MiscDataStreamTest.cs index f958d058f..4cb19884b 100644 --- a/crypto/test/src/cms/test/MiscDataStreamTest.cs +++ b/crypto/test/src/cms/test/MiscDataStreamTest.cs @@ -207,15 +207,12 @@ namespace Org.BouncyCastle.Cms.Tests sp.GetSignedContent().Drain(); - // - // compute expected content digest - // - IDigest md = DigestUtilities.GetDigest("SHA1"); - byte[] cDataOutBytes = cDataOut.ToArray(); - md.BlockUpdate(cDataOutBytes, 0, cDataOutBytes.Length); - byte[] hash = DigestUtilities.DoFinal(md); - - VerifySignatures(sp, hash); + byte[] cDataOutBytes = cDataOut.ToArray(); + + // compute expected content digest + byte[] hash = DigestUtilities.CalculateDigest("SHA1", cDataOutBytes); + + VerifySignatures(sp, hash); } } } |