Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8026976: ECParameters, Point does not match field size #2958

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -294,7 +294,13 @@ <T extends KeySpec> T implGetPublicKeySpec(P11Key key, Class<T> 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);
Expand Down
1 change: 0 additions & 1 deletion test/jdk/ProblemList.txt
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,6 @@ com/sun/nio/sctp/SctpChannel/SocketOptionTests.java 8141694 linux-al

# jdk_security

sun/security/pkcs11/ec/TestKeyFactory.java 8026976 generic-all
sun/security/pkcs11/KeyStore/ClientAuth.sh 8254806 solaris-all
sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java 8161536 generic-all

Expand Down