JDK-7195409 : CertPath/CertPathValidatorTest/KeyParamsInheritanceTest fails with NullPointerException
  • Type: Bug
  • Component: security-libs
  • Sub-Component: java.security
  • Affected Version: 8
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: linux
  • CPU: x86
  • Submitted: 2012-08-31
  • Updated: 2017-12-21
  • Resolved: 2012-09-25
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 Other
8 b58Fixed openjdk7uFixed
Related Reports
Relates :  
Description
There is a sqe test named CertPath/CertPathValidatorTest/KeyParamsInheritanceTest fails even after the fix for 7187962 is integrated:

Test CertPath/CertPathValidatorTest/KeyParamsInheritanceTest fails for NullPointerException:
Testing : failure builder test: initial trusted key has no params: forward
java.lang.NullPointerException


 Testing : failure builder test: initial trusted key has no params: reverse
java.lang.NullPointerException

The fix for 7187962 solves the certpath validator issue, but looks like there is still regression with certpath builder.
Exception StackTrace:
java.lang.NullPointerException
        at sun.security.pkcs11.P11DSAKeyFactory.implTranslatePublicKey(P11DSAKey
Factory.java:57)
        at sun.security.pkcs11.P11KeyFactory.engineTranslateKey(P11KeyFactory.ja
va:127)
        at sun.security.pkcs11.P11KeyFactory.convertKey(P11KeyFactory.java:64)
        at sun.security.pkcs11.P11Signature.engineInitVerify(P11Signature.java:3
78)
        at java.security.Signature$Delegate.init(Signature.java:1103)
        at java.security.Signature$Delegate.chooseProvider(Signature.java:1066)
        at java.security.Signature$Delegate.engineInitVerify(Signature.java:1121
)
        at java.security.Signature.initVerify(Signature.java:451)
        at sun.security.x509.X509CertImpl.verify(X509CertImpl.java:440)
        at sun.security.x509.X509CertImpl.verify(X509CertImpl.java:394)
        at sun.security.x509.X509CertImpl.verify(X509CertImpl.java:394)
        at sun.security.provider.certpath.ReverseBuilder.verifyCert(ReverseBuild
er.java:516)
        at sun.security.provider.certpath.SunCertPathBuilder.depthFirstSearchRev
erse(SunCertPathBuilder.java:668)
        at sun.security.provider.certpath.SunCertPathBuilder.buildReverse(SunCer
tPathBuilder.java:252)
        at sun.security.provider.certpath.SunCertPathBuilder.buildCertPath(SunCe
rtPathBuilder.java:167)
        at sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBu
ilder.java:136)
        at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCert
PathBuilder.java:131)
        at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:280)
        at BuildCertPath.doBuild(BuildCertPath.java:397)
        at KeyParamsInheritanceTest.builderTestFailure(KeyParamsInheritanceTest.
java:621)
        at KeyParamsInheritanceTest.doBuilderTests(KeyParamsInheritanceTest.java
:560)
        at KeyParamsInheritanceTest.doTest(KeyParamsInheritanceTest.java:198)
        at KeyParamsInheritanceTest.runTest(KeyParamsInheritanceTest.java:144)
        at KeyParamsInheritanceTest.main(KeyParamsInheritanceTest.java:127)

Comments
SUGGESTED FIX Changeset: 17881ebf811c Author: mullan Date: 2012-09-16 13:29 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/17881ebf811c 7195409: CertPath/CertPathValidatorTest/KeyParamsInheritanceTest fails with NullPointerException Reviewed-by: xuelei ! src/share/classes/sun/security/provider/certpath/AlgorithmChecker.java ! src/share/classes/sun/security/provider/certpath/BasicChecker.java ! src/share/classes/sun/security/provider/certpath/ForwardBuilder.java ! src/share/classes/sun/security/provider/certpath/ForwardState.java ! src/share/classes/sun/security/provider/certpath/PKIX.java ! src/share/classes/sun/security/provider/certpath/ReverseState.java ! src/share/classes/sun/security/provider/certpath/RevocationChecker.java ! src/share/classes/sun/security/provider/certpath/SunCertPathBuilder.java
16-09-2012

EVALUATION We need to make similar changes as were made for 7187962 for CertPathBuilder but in this case we should skip (not use) any TrustAnchors that contain a DSA PublicKey with no params when building a CertPath. Changes have to be made to both forward and reverse mode.
12-09-2012