JDK-7157786 : jce/ECC fails on Linux and Solaris-sparc for "Could not parse key"
  • Type: Bug
  • Component: security-libs
  • Sub-Component: java.security
  • Affected Version: 7,8
  • Priority: P3
  • Status: Resolved
  • Resolution: Duplicate
  • OS: linux,solaris,windows
  • CPU: x86
  • Submitted: 2012-03-29
  • Updated: 2016-05-25
  • Resolved: 2013-09-11
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
8Resolved
Related Reports
Duplicate :  
Relates :  
Description
After updating the NSS libs in sqe test suite to the latest versions, the jce/ECC test still fails due to:
"java.security.spec.InvalidKeySpecException: Could not parse key" exception

The test is being tried on both Solaris-sparc and Linux platforms. And the two tries throw the same exceptions. So this is not like CR 7152169 which only happens on Solaris-sparc.

This exception is thrown for this line of TestKeyFactory.java: 
KeySpec keySpec = kf.getKeySpec(key, ECPublicKeySpec.class);

And the stacktrace is like:
java.security.spec.InvalidKeySpecException: Could not parse key
at
sun.security.pkcs11.P11ECKeyFactory.implGetPublicKeySpec(P11ECKeyFactory.java:276)

at
sun.security.pkcs11.P11KeyFactory.engineGetKeySpec(P11KeyFactory.java:94)
at java.security.KeyFactory.getKeySpec(KeyFactory.java:413)
at TestKeyFactory.testPublic(TestKeyFactory.java:55)
at TestKeyFactory.test(TestKeyFactory.java:100)
at TestKeyFactory.main(TestKeyFactory.java:136)
Caused by: java.io.IOException: Point does not match field size
at sun.security.ec.ECParameters.decodePoint(ECParameters.java:92)
at
sun.security.pkcs11.P11ECKeyFactory.decodePoint(P11ECKeyFactory.java:80)
at
sun.security.pkcs11.P11ECKeyFactory.implGetPublicKeySpec(P11ECKeyFactory.java:273)

... 5 more

Comments
After changes to PKCS11Test, the parent of this test. I've seen these failures on Windows as well. The only machines I've seen success in JPRT are those with no ECC support in NSS.
15-07-2013

For DKFL: jce/ECC/KeyFactory
11-07-2013

SQE Test jce/ECC is failing due to this bug
28-11-2012