summary refs log tree commit diff
path: root/crypto/src/x509/X509Certificate.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2023-05-04 16:43:06 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2023-05-04 16:43:06 +0700
commite7cb9e780da9b4ed2cee55feb0c4e7302222267d (patch)
treeb5fb6c8609afbc925021b763b06b45e61df3c4f8 /crypto/src/x509/X509Certificate.cs
parentUpdate Dilithium PrivateKeyInfo code from bc-java (diff)
downloadBouncyCastle.NET-ed25519-e7cb9e780da9b4ed2cee55feb0c4e7302222267d.tar.xz
Refactoring around BasicConstraints
Diffstat (limited to 'crypto/src/x509/X509Certificate.cs')
-rw-r--r--crypto/src/x509/X509Certificate.cs13
1 files changed, 3 insertions, 10 deletions
diff --git a/crypto/src/x509/X509Certificate.cs b/crypto/src/x509/X509Certificate.cs
index c903811d4..30cdd6e2d 100644
--- a/crypto/src/x509/X509Certificate.cs
+++ b/crypto/src/x509/X509Certificate.cs
@@ -364,17 +364,10 @@ namespace Org.BouncyCastle.X509
 
         public virtual int GetBasicConstraints()
         {
-            if (basicConstraints != null && basicConstraints.IsCA())
-            {
-                if (basicConstraints.PathLenConstraint == null)
-                {
-                    return int.MaxValue;
-                }
-
-                return basicConstraints.PathLenConstraint.IntValue;
-            }
+            if (basicConstraints == null || !basicConstraints.IsCA())
+                return -1;
 
-            return -1;
+            return basicConstraints.PathLenConstraint_Int32;
         }
 
         public virtual GeneralNames GetIssuerAlternativeNameExtension()