summary refs log tree commit diff
path: root/crypto
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2014-07-22 11:55:15 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2014-07-22 11:55:15 +0700
commitd0c09ebad8713c772d7dc280f86234270cf99616 (patch)
tree1b5226f6b4296f18d0024141b41cf6398df93487 /crypto
parentBMA-105 (diff)
downloadBouncyCastle.NET-ed25519-d0c09ebad8713c772d7dc280f86234270cf99616.tar.xz
Port of encoding fix from Java
Diffstat (limited to 'crypto')
-rw-r--r--crypto/src/crypto/tls/CertificateRequest.cs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/src/crypto/tls/CertificateRequest.cs b/crypto/src/crypto/tls/CertificateRequest.cs
index 8ab265513..100398ffb 100644
--- a/crypto/src/crypto/tls/CertificateRequest.cs
+++ b/crypto/src/crypto/tls/CertificateRequest.cs
@@ -100,7 +100,7 @@ namespace Org.BouncyCastle.Crypto.Tls
                 {
                     byte[] derEncoding = certificateAuthority.GetEncoded(Asn1Encodable.Der);
                     derEncodings.Add(derEncoding);
-                    totalLength += derEncoding.Length;
+                    totalLength += derEncoding.Length + 2;
                 }
 
                 TlsUtilities.CheckUint16(totalLength);
@@ -108,7 +108,7 @@ namespace Org.BouncyCastle.Crypto.Tls
 
                 foreach (byte[] derEncoding in derEncodings)
                 {
-                    output.Write(derEncoding, 0, derEncoding.Length);
+                    TlsUtilities.WriteOpaque16(derEncoding, output);
                 }
             }
         }