summary refs log tree commit diff
path: root/crypto/src/pkix
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/pkix
parentRefactoring around BasicConstraints (diff)
downloadBouncyCastle.NET-ed25519-eec1e384fc311c22550cc4654fcf8272d65e2978.tar.xz
Improvements to pathLenConstraints checks
Diffstat (limited to 'crypto/src/pkix')
-rw-r--r--crypto/src/pkix/Rfc3280CertPathUtilities.cs8
1 files changed, 6 insertions, 2 deletions
diff --git a/crypto/src/pkix/Rfc3280CertPathUtilities.cs b/crypto/src/pkix/Rfc3280CertPathUtilities.cs
index 88b842abb..82fe44c35 100644
--- a/crypto/src/pkix/Rfc3280CertPathUtilities.cs
+++ b/crypto/src/pkix/Rfc3280CertPathUtilities.cs
@@ -1778,8 +1778,12 @@ namespace Org.BouncyCastle.Pkix
 			}
 			if (bc != null && bc.IsCA())
 			{
-				maxPathLength = System.Math.Min(maxPathLength, bc.PathLenConstraint_Int32);
-			}
+				var pathLenConstraint = bc.PathLenConstraintInteger;
+				if (pathLenConstraint != null)
+				{
+                    maxPathLength = System.Math.Min(maxPathLength, pathLenConstraint.IntPositiveValueExact);
+                }
+            }
 			return maxPathLength;
 		}