mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8217610: TLSv1.3 fail with ClassException when EC keys are stored in PKCS11
Reviewed-by: valeriep
This commit is contained in:
parent
2f20909d10
commit
661b5f1534
7 changed files with 36 additions and 16 deletions
|
@ -35,7 +35,6 @@ import java.security.KeyPairGenerator;
|
|||
import java.security.PrivateKey;
|
||||
import java.security.PublicKey;
|
||||
import java.security.SecureRandom;
|
||||
import java.security.interfaces.ECPrivateKey;
|
||||
import java.security.interfaces.ECPublicKey;
|
||||
import java.security.spec.AlgorithmParameterSpec;
|
||||
import java.security.spec.ECGenParameterSpec;
|
||||
|
@ -265,12 +264,12 @@ final class ECDHKeyExchange {
|
|||
continue;
|
||||
}
|
||||
|
||||
PrivateKey privateKey = ((X509Possession)poss).popPrivateKey;
|
||||
if (!privateKey.getAlgorithm().equals("EC")) {
|
||||
ECParameterSpec params =
|
||||
((X509Possession)poss).getECParameterSpec();
|
||||
if (params == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
ECParameterSpec params = ((ECPrivateKey)privateKey).getParams();
|
||||
NamedGroup ng = NamedGroup.valueOf(params);
|
||||
if (ng == null) {
|
||||
// unlikely, have been checked during cipher suite negotiation.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue