提交 c6bf3bbb 编写于 作者: M mullan

7038175: Expired PKITS certificates causing CertPathBuilder and...

7038175: Expired PKITS certificates causing CertPathBuilder and CertPathValidator regression test failures
Reviewed-by: xuelei
上级 a227af76
...@@ -312,7 +312,8 @@ class CrlRevocationChecker extends PKIXCertPathChecker { ...@@ -312,7 +312,8 @@ class CrlRevocationChecker extends PKIXCertPathChecker {
DistributionPointFetcher.getInstance(); DistributionPointFetcher.getInstance();
// all CRLs returned by the DP Fetcher have also been verified // all CRLs returned by the DP Fetcher have also been verified
mApprovedCRLs.addAll(store.getCRLs(sel, signFlag, prevKey, mApprovedCRLs.addAll(store.getCRLs(sel, signFlag, prevKey,
mSigProvider, mStores, reasonsMask, trustAnchors)); mSigProvider, mStores, reasonsMask, trustAnchors,
mParams.getDate()));
} catch (Exception e) { } catch (Exception e) {
if (debug != null) { if (debug != null) {
debug.println("CrlRevocationChecker.verifyRevocationStatus() " debug.println("CrlRevocationChecker.verifyRevocationStatus() "
...@@ -769,7 +770,7 @@ class CrlRevocationChecker extends PKIXCertPathChecker { ...@@ -769,7 +770,7 @@ class CrlRevocationChecker extends PKIXCertPathChecker {
for (X509CRL crl : crls) { for (X509CRL crl : crls) {
if (dpf.verifyCRL(certImpl, point, crl, reasonsMask, if (dpf.verifyCRL(certImpl, point, crl, reasonsMask,
signFlag, prevKey, mSigProvider, signFlag, prevKey, mSigProvider,
trustAnchors, mStores)) { trustAnchors, mStores, mParams.getDate())) {
results.add(crl); results.add(crl);
} }
} }
......
...@@ -90,8 +90,8 @@ class DistributionPointFetcher { ...@@ -90,8 +90,8 @@ class DistributionPointFetcher {
*/ */
Collection<X509CRL> getCRLs(X509CRLSelector selector, boolean signFlag, Collection<X509CRL> getCRLs(X509CRLSelector selector, boolean signFlag,
PublicKey prevKey, String provider, List<CertStore> certStores, PublicKey prevKey, String provider, List<CertStore> certStores,
boolean[] reasonsMask, boolean[] reasonsMask, Set<TrustAnchor> trustAnchors,
Set<TrustAnchor> trustAnchors) throws CertStoreException { Date validity) throws CertStoreException {
if (USE_CRLDP == false) { if (USE_CRLDP == false) {
return Collections.emptySet(); return Collections.emptySet();
...@@ -122,7 +122,7 @@ class DistributionPointFetcher { ...@@ -122,7 +122,7 @@ class DistributionPointFetcher {
DistributionPoint point = t.next(); DistributionPoint point = t.next();
Collection<X509CRL> crls = getCRLs(selector, certImpl, Collection<X509CRL> crls = getCRLs(selector, certImpl,
point, reasonsMask, signFlag, prevKey, provider, point, reasonsMask, signFlag, prevKey, provider,
certStores, trustAnchors); certStores, trustAnchors, validity);
results.addAll(crls); results.addAll(crls);
} }
if (debug != null) { if (debug != null) {
...@@ -143,7 +143,8 @@ class DistributionPointFetcher { ...@@ -143,7 +143,8 @@ class DistributionPointFetcher {
private Collection<X509CRL> getCRLs(X509CRLSelector selector, private Collection<X509CRL> getCRLs(X509CRLSelector selector,
X509CertImpl certImpl, DistributionPoint point, boolean[] reasonsMask, X509CertImpl certImpl, DistributionPoint point, boolean[] reasonsMask,
boolean signFlag, PublicKey prevKey, String provider, boolean signFlag, PublicKey prevKey, String provider,
List<CertStore> certStores, Set<TrustAnchor> trustAnchors) { List<CertStore> certStores, Set<TrustAnchor> trustAnchors,
Date validity) {
// check for full name // check for full name
GeneralNames fullName = point.getFullName(); GeneralNames fullName = point.getFullName();
...@@ -196,7 +197,7 @@ class DistributionPointFetcher { ...@@ -196,7 +197,7 @@ class DistributionPointFetcher {
selector.setIssuerNames(null); selector.setIssuerNames(null);
if (selector.match(crl) && verifyCRL(certImpl, point, crl, if (selector.match(crl) && verifyCRL(certImpl, point, crl,
reasonsMask, signFlag, prevKey, provider, trustAnchors, reasonsMask, signFlag, prevKey, provider, trustAnchors,
certStores)) { certStores, validity)) {
crls.add(crl); crls.add(crl);
} }
} catch (Exception e) { } catch (Exception e) {
...@@ -280,13 +281,15 @@ class DistributionPointFetcher { ...@@ -280,13 +281,15 @@ class DistributionPointFetcher {
* @param trustAnchors a {@code Set} of {@code TrustAnchor}s * @param trustAnchors a {@code Set} of {@code TrustAnchor}s
* @param certStores a {@code List} of {@code CertStore}s to be used in * @param certStores a {@code List} of {@code CertStore}s to be used in
* finding certificates and CRLs * finding certificates and CRLs
* @param validity the time for which the validity of the CRL issuer's
* certification path should be determined
* @return true if ok, false if not * @return true if ok, false if not
*/ */
boolean verifyCRL(X509CertImpl certImpl, DistributionPoint point, boolean verifyCRL(X509CertImpl certImpl, DistributionPoint point,
X509CRL crl, boolean[] reasonsMask, boolean signFlag, X509CRL crl, boolean[] reasonsMask, boolean signFlag,
PublicKey prevKey, String provider, PublicKey prevKey, String provider,
Set<TrustAnchor> trustAnchors, Set<TrustAnchor> trustAnchors, List<CertStore> certStores,
List<CertStore> certStores) throws CRLException, IOException { Date validity) throws CRLException, IOException {
boolean indirectCRL = false; boolean indirectCRL = false;
X509CRLImpl crlImpl = X509CRLImpl.toImpl(crl); X509CRLImpl crlImpl = X509CRLImpl.toImpl(crl);
...@@ -605,6 +608,7 @@ class DistributionPointFetcher { ...@@ -605,6 +608,7 @@ class DistributionPointFetcher {
} }
params.setCertStores(certStores); params.setCertStores(certStores);
params.setSigProvider(provider); params.setSigProvider(provider);
params.setDate(validity);
try { try {
CertPathBuilder builder = CertPathBuilder.getInstance("PKIX"); CertPathBuilder builder = CertPathBuilder.getInstance("PKIX");
PKIXCertPathBuilderResult result = PKIXCertPathBuilderResult result =
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册