8025287: NPE in api/java_security/cert/PKIXRevocationChecker/GeneralTests_GeneralTests
Reviewed-by: mullan
--- a/jdk/src/share/classes/sun/security/provider/certpath/RevocationChecker.java Tue Oct 22 11:25:01 2013 -0700
+++ b/jdk/src/share/classes/sun/security/provider/certpath/RevocationChecker.java Tue Oct 22 11:57:38 2013 -0700
@@ -307,7 +307,7 @@
: anchor.getCAPublicKey();
}
crlSignFlag = true;
- if (params.certPath() != null) {
+ if (params != null && params.certPath() != null) {
certIndex = params.certPath().getCertificates().size() - 1;
} else {
certIndex = -1;
--- a/jdk/test/java/security/cert/PKIXRevocationChecker/UnitTest.java Tue Oct 22 11:25:01 2013 -0700
+++ b/jdk/test/java/security/cert/PKIXRevocationChecker/UnitTest.java Tue Oct 22 11:57:38 2013 -0700
@@ -23,7 +23,7 @@
/**
* @test
- * @bug 6854712 7171570 8010748
+ * @bug 6854712 7171570 8010748 8025287
* @summary Basic unit test for PKIXRevocationChecker
*/
@@ -44,6 +44,8 @@
CertPathChecker cpc = cpv.getRevocationChecker();
PKIXRevocationChecker prc = (PKIXRevocationChecker)cpc;
+ prc.init(false);
+
System.out.println("Testing that get methods return null or " +
"empty lists/sets/maps");
requireNull(prc.getOcspResponder(), "getOcspResponder()");