diff --git a/jdk/src/share/classes/sun/security/pkcs11/P11ECKeyFactory.java b/jdk/src/share/classes/sun/security/pkcs11/P11ECKeyFactory.java index 7c3b93e0400..1fc45172198 100644 --- a/jdk/src/share/classes/sun/security/pkcs11/P11ECKeyFactory.java +++ b/jdk/src/share/classes/sun/security/pkcs11/P11ECKeyFactory.java @@ -294,7 +294,13 @@ T implGetPublicKeySpec(P11Key key, Class keySpec, try { token.p11.C_GetAttributeValue(session[0].id(), keyID, attributes); ECParameterSpec params = decodeParameters(attributes[1].getByteArray()); - ECPoint point = decodePoint(attributes[0].getByteArray(), params.getCurve()); + ECPoint point; + + if (!token.config.getUseEcX963Encoding()) { + point = decodePoint(new DerValue(attributes[0].getByteArray()).getOctetString(), params.getCurve()); + } else { + point = decodePoint(attributes[0].getByteArray(), params.getCurve()); + } return keySpec.cast(new ECPublicKeySpec(point, params)); } catch (IOException e) { throw new InvalidKeySpecException("Could not parse key", e); diff --git a/jdk/test/ProblemList.txt b/jdk/test/ProblemList.txt index 0d432b16a2b..6da2ef5df33 100644 --- a/jdk/test/ProblemList.txt +++ b/jdk/test/ProblemList.txt @@ -277,8 +277,6 @@ sun/rmi/transport/tcp/DisableRMIOverHttp/DisableRMIOverHTTPTest.java windows- # jdk_security -# 8026976 -sun/security/pkcs11/ec/TestKeyFactory.java generic-all # 8180837 sun/security/pkcs11/Secmod/AddTrustedCert.java generic-all sun/security/pkcs11/tls/TestKeyMaterial.java generic-all