summary refs log tree commit diff
path: root/crypto/src/tls/CertificateRequest.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2021-11-06 01:09:09 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2021-11-06 01:09:09 +0700
commit24d60bb782a73f6e1d0419eb764c20d4d7c955ae (patch)
tree13483b7bfd559364e0bf4d1b725d19ea8ea0ed28 /crypto/src/tls/CertificateRequest.cs
parentUpdate git URL (diff)
downloadBouncyCastle.NET-ed25519-24d60bb782a73f6e1d0419eb764c20d4d7c955ae.tar.xz
TLS: Improve ASN.1 parsing
Diffstat (limited to 'crypto/src/tls/CertificateRequest.cs')
-rw-r--r--crypto/src/tls/CertificateRequest.cs6
1 files changed, 4 insertions, 2 deletions
diff --git a/crypto/src/tls/CertificateRequest.cs b/crypto/src/tls/CertificateRequest.cs
index 1abf01aed..8005731f4 100644
--- a/crypto/src/tls/CertificateRequest.cs
+++ b/crypto/src/tls/CertificateRequest.cs
@@ -263,8 +263,10 @@ namespace Org.BouncyCastle.Tls
                     do
                     {
                         byte[] derEncoding = TlsUtilities.ReadOpaque16(bis, 1);
-                        Asn1Object asn1 = TlsUtilities.ReadDerObject(derEncoding);
-                        certificateAuthorities.Add(X509Name.GetInstance(asn1));
+                        Asn1Object asn1 = TlsUtilities.ReadAsn1Object(derEncoding);
+                        X509Name ca = X509Name.GetInstance(asn1);
+                        TlsUtilities.RequireDerEncoding(ca, derEncoding);
+                        certificateAuthorities.Add(ca);
                     }
                     while (bis.Position < bis.Length);
                 }