summary refs log tree commit diff
path: root/crypto/src/tls/OcspStatusRequest.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/OcspStatusRequest.cs
parentUpdate git URL (diff)
downloadBouncyCastle.NET-ed25519-24d60bb782a73f6e1d0419eb764c20d4d7c955ae.tar.xz
TLS: Improve ASN.1 parsing
Diffstat (limited to 'crypto/src/tls/OcspStatusRequest.cs')
-rw-r--r--crypto/src/tls/OcspStatusRequest.cs9
1 files changed, 7 insertions, 2 deletions
diff --git a/crypto/src/tls/OcspStatusRequest.cs b/crypto/src/tls/OcspStatusRequest.cs
index b52517e06..8679022ec 100644
--- a/crypto/src/tls/OcspStatusRequest.cs
+++ b/crypto/src/tls/OcspStatusRequest.cs
@@ -89,7 +89,9 @@ namespace Org.BouncyCastle.Tls
                     do
                     {
                         byte[] derEncoding = TlsUtilities.ReadOpaque16(buf, 1);
-                        ResponderID responderID = ResponderID.GetInstance(TlsUtilities.ReadDerObject(derEncoding));
+                        Asn1Object asn1 = TlsUtilities.ReadAsn1Object(derEncoding);
+                        ResponderID responderID = ResponderID.GetInstance(asn1);
+                        TlsUtilities.RequireDerEncoding(responderID, derEncoding);
                         responderIDList.Add(responderID);
                     }
                     while (buf.Position < buf.Length);
@@ -101,7 +103,10 @@ namespace Org.BouncyCastle.Tls
                 byte[] derEncoding = TlsUtilities.ReadOpaque16(input);
                 if (derEncoding.Length > 0)
                 {
-                    requestExtensions = X509Extensions.GetInstance(TlsUtilities.ReadDerObject(derEncoding));
+                    Asn1Object asn1 = TlsUtilities.ReadAsn1Object(derEncoding);
+                    X509Extensions extensions = X509Extensions.GetInstance(asn1);
+                    TlsUtilities.RequireDerEncoding(extensions, derEncoding);
+                    requestExtensions = extensions;
                 }
             }