summary refs log tree commit diff
path: root/crypto/test
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2019-07-31 16:54:19 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2019-07-31 16:54:19 +0700
commited0df3da696f2734690542534ef98536c66e1efa (patch)
tree1fce205e8219da61afd41635a002673366991c48 /crypto/test
parentWork on EC parameters classes (diff)
downloadBouncyCastle.NET-ed25519-ed0df3da696f2734690542534ef98536c66e1efa.tar.xz
Fix CMP tests failing to set body
Diffstat (limited to 'crypto/test')
-rw-r--r--crypto/test/src/cmp/test/ProtectedMessageTest.cs10
1 files changed, 6 insertions, 4 deletions
diff --git a/crypto/test/src/cmp/test/ProtectedMessageTest.cs b/crypto/test/src/cmp/test/ProtectedMessageTest.cs
index 70bf670da..034463310 100644
--- a/crypto/test/src/cmp/test/ProtectedMessageTest.cs
+++ b/crypto/test/src/cmp/test/ProtectedMessageTest.cs
@@ -220,8 +220,9 @@ namespace Org.BouncyCastle.Cmp.Tests
             GeneralName sender = new GeneralName(new X509Name("CN=Sender"));
             GeneralName recipient = new GeneralName(new X509Name("CN=Recip"));
 
-            ProtectedPkiMessageBuilder msgBuilder = new ProtectedPkiMessageBuilder(sender, recipient);
-            msgBuilder.AddCmpCertificate(cert);
+            ProtectedPkiMessageBuilder msgBuilder = new ProtectedPkiMessageBuilder(sender, recipient)
+                .SetBody(new PkiBody(PkiBody.TYPE_INIT_REP, CertRepMessage.GetInstance(new DerSequence(new DerSequence()))))
+                .AddCmpCertificate(cert);
 
             ISignatureFactory sigFact = new Asn1SignatureFactory("MD5WithRSA", rsaKeyPair.Private);
 
@@ -254,8 +255,9 @@ namespace Org.BouncyCastle.Cmp.Tests
             GeneralName sender = new GeneralName(new X509Name("CN=Sender"));
             GeneralName recipient = new GeneralName(new X509Name("CN=Recip"));
 
-            ProtectedPkiMessageBuilder msgBuilder = new ProtectedPkiMessageBuilder(sender, recipient);
-            msgBuilder.AddCmpCertificate(cert);
+            ProtectedPkiMessageBuilder msgBuilder = new ProtectedPkiMessageBuilder(sender, recipient)
+                .SetBody(new PkiBody(PkiBody.TYPE_INIT_REP, CertRepMessage.GetInstance(new DerSequence(new DerSequence()))))
+                .AddCmpCertificate(cert);
 
             //
             // Default instance.