summary refs log tree commit diff
path: root/crypto/src/x509
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2023-05-05 19:00:34 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2023-05-05 19:00:34 +0700
commiteec1e384fc311c22550cc4654fcf8272d65e2978 (patch)
treed08b71b94008b1065b8612d9c20af860fa61c92a /crypto/src/x509
parentRefactoring around BasicConstraints (diff)
downloadBouncyCastle.NET-ed25519-eec1e384fc311c22550cc4654fcf8272d65e2978.tar.xz
Improvements to pathLenConstraints checks
Diffstat (limited to 'crypto/src/x509')
-rw-r--r--crypto/src/x509/X509Certificate.cs6
1 files changed, 5 insertions, 1 deletions
diff --git a/crypto/src/x509/X509Certificate.cs b/crypto/src/x509/X509Certificate.cs
index 30cdd6e2d..b1307d90e 100644
--- a/crypto/src/x509/X509Certificate.cs
+++ b/crypto/src/x509/X509Certificate.cs
@@ -367,7 +367,11 @@ namespace Org.BouncyCastle.X509
             if (basicConstraints == null || !basicConstraints.IsCA())
                 return -1;
 
-            return basicConstraints.PathLenConstraint_Int32;
+            var pathLenConstraint = basicConstraints.PathLenConstraintInteger;
+            if (pathLenConstraint == null)
+                return int.MaxValue;
+
+            return pathLenConstraint.IntPositiveValueExact;
         }
 
         public virtual GeneralNames GetIssuerAlternativeNameExtension()