summary refs log tree commit diff
path: root/crypto/test/src/cms
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2017-09-17 17:37:25 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2017-09-17 17:37:25 +0700
commitb90398d12fa57868910ab10566cd0f27cdd99aba (patch)
tree7f8d35212d0decbb399f47cfad6b4b0993a0fd24 /crypto/test/src/cms
parentAdd new PGP signature testcase (diff)
downloadBouncyCastle.NET-ed25519-b90398d12fa57868910ab10566cd0f27cdd99aba.tar.xz
Add testcase for RAW PKCS#1 signatures missing DER NULL
Diffstat (limited to 'crypto/test/src/cms')
-rw-r--r--crypto/test/src/cms/test/SignedDataTest.cs18
1 files changed, 18 insertions, 0 deletions
diff --git a/crypto/test/src/cms/test/SignedDataTest.cs b/crypto/test/src/cms/test/SignedDataTest.cs
index 89f7eea7d..29d0464c2 100644
--- a/crypto/test/src/cms/test/SignedDataTest.cs
+++ b/crypto/test/src/cms/test/SignedDataTest.cs
@@ -672,6 +672,24 @@ namespace Org.BouncyCastle.Cms.Tests
 			VerifySignatures(s, hash);
 		}
 
+        [Test]
+        public void TestRawSha256MissingNull()
+        {
+            byte[] document = GetInput("rawsha256nonull.p7m");
+
+            CmsSignedData s = new CmsSignedData(document);
+
+            IX509Store certStore = s.GetCertificates("Collection");
+            foreach (SignerInformation signerInformation in s.GetSignerInfos().GetSigners())
+            {
+                ICollection certCollection = certStore.GetMatches(signerInformation.SignerID);
+                foreach (X509Certificate cert in certCollection)
+                {
+                    Assert.IsTrue(signerInformation.Verify(cert), "raw sig failed");
+                }
+            }
+        }
+
 		[Test]
 		public void TestSha1WithRsaEncapsulated()
 		{