diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2023-01-27 01:58:23 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2023-01-27 01:58:23 +0700 |
commit | e71fe27c302d36e6355d9da12f3d9ec51540825a (patch) | |
tree | 6aa065f627d14e659e68ae0cbe355b656af3e40f /crypto/src/pkix/Rfc3281CertPathUtilities.cs | |
parent | Add CrlID.GetInstance methods, obsolete public constructor (diff) | |
download | BouncyCastle.NET-ed25519-e71fe27c302d36e6355d9da12f3d9ec51540825a.tar.xz |
Misc. cleanup after bc-fips-csharp updates
Diffstat (limited to 'crypto/src/pkix/Rfc3281CertPathUtilities.cs')
-rw-r--r-- | crypto/src/pkix/Rfc3281CertPathUtilities.cs | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/crypto/src/pkix/Rfc3281CertPathUtilities.cs b/crypto/src/pkix/Rfc3281CertPathUtilities.cs index 4d12ad0c0..b0746bc83 100644 --- a/crypto/src/pkix/Rfc3281CertPathUtilities.cs +++ b/crypto/src/pkix/Rfc3281CertPathUtilities.cs @@ -253,26 +253,21 @@ namespace Org.BouncyCastle.Pkix } } - internal static void ProcessAttrCert4( - X509Certificate acIssuerCert, - PkixParameters pkixParams) + internal static void ProcessAttrCert4(X509Certificate acIssuerCert, PkixParameters pkixParams) { - var set = pkixParams.GetTrustedACIssuers(); - bool trusted = false; - foreach (TrustAnchor anchor in set) + foreach (var anchor in pkixParams.GetTrustedACIssuers()) { var symbols = X509Name.RFC2253Symbols; + if (acIssuerCert.SubjectDN.ToString(false, symbols).Equals(anchor.CAName) || acIssuerCert.Equals(anchor.TrustedCert)) { - trusted = true; + // Trusted + return; } } - if (!trusted) - { - throw new PkixCertPathValidatorException( - "Attribute certificate issuer is not directly trusted."); - } + + throw new PkixCertPathValidatorException("Attribute certificate issuer is not directly trusted."); } internal static void ProcessAttrCert3( |