diff options
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( |