diff options
-rw-r--r-- | mcs/class/System/System.Security.Cryptography.X509Certificates/X509Chain.cs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/mcs/class/System/System.Security.Cryptography.X509Certificates/X509Chain.cs b/mcs/class/System/System.Security.Cryptography.X509Certificates/X509Chain.cs index 99f40f4d0c1..7dfd434c85a 100644 --- a/mcs/class/System/System.Security.Cryptography.X509Certificates/X509Chain.cs +++ b/mcs/class/System/System.Security.Cryptography.X509Certificates/X509Chain.cs @@ -878,8 +878,12 @@ namespace System.Security.Cryptography.X509Certificates { return X509ChainStatusFlags.NoError; } - static MX.X509Crl CheckCrls (string subject, string ski, ArrayList crls) + static MX.X509Crl CheckCrls (string subject, string ski, MX.X509Store store) { + if (store == null) + return null; + + var crls = store.Crls; foreach (MX.X509Crl crl in crls) { if (crl.IssuerName == subject && (ski.Length == 0 || ski == GetAuthorityKeyIdentifier (crl))) return crl; @@ -893,21 +897,21 @@ namespace System.Security.Cryptography.X509Certificates { string ski = GetSubjectKeyIdentifier (caCertificate); // consider that the LocalMachine directories could not exists... and cannot be created by the user - var result = (LMCAStore.Store == null) ? null : CheckCrls (subject, ski, LMCAStore.Store.Crls); + MX.X509Crl result = CheckCrls (subject, ski, LMCAStore.Store); if (result != null) return result; if (location == StoreLocation.CurrentUser) { - result = CheckCrls (subject, ski, UserCAStore.Store.Crls); + result = CheckCrls (subject, ski, UserCAStore.Store); if (result != null) return result; } // consider that the LocalMachine directories could not exists... and cannot be created by the user - result = (LMRootStore.Store == null) ? null : CheckCrls (subject, ski, LMRootStore.Store.Crls); + result = CheckCrls (subject, ski, LMRootStore.Store); if (result != null) return result; if (location == StoreLocation.CurrentUser) { - result = CheckCrls (subject, ski, UserRootStore.Store.Crls); + result = CheckCrls (subject, ski, UserRootStore.Store); if (result != null) return result; } |