From d0c09ebad8713c772d7dc280f86234270cf99616 Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Tue, 22 Jul 2014 11:55:15 +0700 Subject: Port of encoding fix from Java --- crypto/src/crypto/tls/CertificateRequest.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crypto/src') 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); } } } -- cgit 1.5.1