mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 22:34:27 +02:00
8221271: sun/security/pkcs11/tls/tls12/TestTLS12.java test failed
Reviewed-by: xuelei
This commit is contained in:
parent
a8550e4589
commit
a8a29bbae6
3 changed files with 10 additions and 14 deletions
|
@ -263,13 +263,13 @@ public final class RSACipher extends CipherSpi {
|
||||||
throw new InvalidKeyException("Unknown mode: " + opmode);
|
throw new InvalidKeyException("Unknown mode: " + opmode);
|
||||||
}
|
}
|
||||||
RSAKey rsaKey = RSAKeyFactory.toRSAKey(key);
|
RSAKey rsaKey = RSAKeyFactory.toRSAKey(key);
|
||||||
if (key instanceof RSAPublicKey) {
|
if (rsaKey instanceof RSAPublicKey) {
|
||||||
mode = encrypt ? MODE_ENCRYPT : MODE_VERIFY;
|
mode = encrypt ? MODE_ENCRYPT : MODE_VERIFY;
|
||||||
publicKey = (RSAPublicKey)key;
|
publicKey = (RSAPublicKey)rsaKey;
|
||||||
privateKey = null;
|
privateKey = null;
|
||||||
} else { // must be RSAPrivateKey per check in toRSAKey
|
} else { // must be RSAPrivateKey per check in toRSAKey
|
||||||
mode = encrypt ? MODE_SIGN : MODE_DECRYPT;
|
mode = encrypt ? MODE_SIGN : MODE_DECRYPT;
|
||||||
privateKey = (RSAPrivateKey)key;
|
privateKey = (RSAPrivateKey)rsaKey;
|
||||||
publicKey = null;
|
publicKey = null;
|
||||||
}
|
}
|
||||||
int n = RSACore.getByteLength(rsaKey.getModulus());
|
int n = RSACore.getByteLength(rsaKey.getModulus());
|
||||||
|
|
|
@ -715,7 +715,6 @@ sun/security/pkcs11/tls/TestLeadingZeroesP11.java 8204203 windows-
|
||||||
sun/security/pkcs11/tls/TestMasterSecret.java 8204203 windows-all
|
sun/security/pkcs11/tls/TestMasterSecret.java 8204203 windows-all
|
||||||
sun/security/pkcs11/tls/TestPRF.java 8204203 windows-all
|
sun/security/pkcs11/tls/TestPRF.java 8204203 windows-all
|
||||||
sun/security/pkcs11/tls/TestPremaster.java 8204203 windows-all
|
sun/security/pkcs11/tls/TestPremaster.java 8204203 windows-all
|
||||||
sun/security/pkcs11/tls/tls12/TestTLS12.java 8221271 windows-all
|
|
||||||
sun/security/tools/keytool/NssTest.java 8204203 windows-all
|
sun/security/tools/keytool/NssTest.java 8204203 windows-all
|
||||||
|
|
||||||
############################################################################
|
############################################################################
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
* java.base/sun.security.util
|
* java.base/sun.security.util
|
||||||
* java.base/com.sun.crypto.provider
|
* java.base/com.sun.crypto.provider
|
||||||
* @library /test/lib ../..
|
* @library /test/lib ../..
|
||||||
* @run main/othervm/timeout=120 TestTLS12
|
* @run main/othervm/timeout=120 -Djdk.tls.useExtendedMasterSecret=false TestTLS12
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
@ -37,8 +37,8 @@ import java.io.FileInputStream;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
|
|
||||||
import java.security.interfaces.RSAPrivateKey;
|
import java.security.PrivateKey;
|
||||||
import java.security.interfaces.RSAPublicKey;
|
import java.security.PublicKey;
|
||||||
import java.security.KeyStore;
|
import java.security.KeyStore;
|
||||||
import java.security.NoSuchAlgorithmException;
|
import java.security.NoSuchAlgorithmException;
|
||||||
import java.security.Provider;
|
import java.security.Provider;
|
||||||
|
@ -76,8 +76,8 @@ public final class TestTLS12 extends SecmodTest {
|
||||||
private static KeyStore ks;
|
private static KeyStore ks;
|
||||||
private static KeyStore ts;
|
private static KeyStore ts;
|
||||||
private static char[] passphrase = "JAHshj131@@".toCharArray();
|
private static char[] passphrase = "JAHshj131@@".toCharArray();
|
||||||
private static RSAPrivateKey privateKey;
|
private static PrivateKey privateKey;
|
||||||
private static RSAPublicKey publicKey;
|
private static PublicKey publicKey;
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
try {
|
try {
|
||||||
|
@ -444,14 +444,11 @@ public final class TestTLS12 extends SecmodTest {
|
||||||
ts = ks;
|
ts = ks;
|
||||||
|
|
||||||
KeyStore ksPlain = readTestKeyStore();
|
KeyStore ksPlain = readTestKeyStore();
|
||||||
privateKey = (RSAPrivateKey)ksPlain.getKey("rh_rsa_sha256",
|
privateKey = (PrivateKey)ksPlain.getKey("rh_rsa_sha256",
|
||||||
passphrase);
|
passphrase);
|
||||||
publicKey = (RSAPublicKey)ksPlain.getCertificate(
|
publicKey = (PublicKey)ksPlain.getCertificate(
|
||||||
"rh_rsa_sha256").getPublicKey();
|
"rh_rsa_sha256").getPublicKey();
|
||||||
|
|
||||||
// Extended Master Secret is not currently supported in SunPKCS11
|
|
||||||
// cryptographic provider
|
|
||||||
System.setProperty("jdk.tls.useExtendedMasterSecret", "false");
|
|
||||||
String disabledAlgorithms =
|
String disabledAlgorithms =
|
||||||
Security.getProperty("jdk.tls.disabledAlgorithms");
|
Security.getProperty("jdk.tls.disabledAlgorithms");
|
||||||
if (disabledAlgorithms.length() > 0) {
|
if (disabledAlgorithms.length() > 0) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue