diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2023-05-05 19:00:34 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2023-05-05 19:00:34 +0700 |
commit | eec1e384fc311c22550cc4654fcf8272d65e2978 (patch) | |
tree | d08b71b94008b1065b8612d9c20af860fa61c92a /crypto/src/x509 | |
parent | Refactoring around BasicConstraints (diff) | |
download | BouncyCastle.NET-ed25519-eec1e384fc311c22550cc4654fcf8272d65e2978.tar.xz |
Improvements to pathLenConstraints checks
Diffstat (limited to 'crypto/src/x509')
-rw-r--r-- | crypto/src/x509/X509Certificate.cs | 6 |
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() |