diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2021-11-06 01:09:09 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2021-11-06 01:09:09 +0700 |
commit | 24d60bb782a73f6e1d0419eb764c20d4d7c955ae (patch) | |
tree | 13483b7bfd559364e0bf4d1b725d19ea8ea0ed28 /crypto/src/tls/OcspStatusRequest.cs | |
parent | Update git URL (diff) | |
download | BouncyCastle.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.cs | 9 |
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; } } |