Mercurial > hg > icedtea9-forest > jdk
changeset 4879:6e59c482e9b8
7105940: Test regression: KeyStore must be from provider SunPKCS11-NSSKeyStore
Reviewed-by: weijun
author | xuelei |
---|---|
date | Fri, 28 Oct 2011 07:18:54 -0700 |
parents | 8cd2e3b8127a |
children | bb2b9a8b6e77 |
files | test/sun/security/pkcs11/fips/CipherTest.java test/sun/security/pkcs11/fips/ClientJSSEServerJSSE.java |
diffstat | 2 files changed, 39 insertions(+), 44 deletions(-) [+] |
line wrap: on
line diff
--- a/test/sun/security/pkcs11/fips/CipherTest.java Thu Oct 27 11:01:15 2011 -0400 +++ b/test/sun/security/pkcs11/fips/CipherTest.java Fri Oct 28 07:18:54 2011 -0700 @@ -394,52 +394,47 @@ public static void main(PeerFactory peerFactory, KeyStore keyStore, String[] args) throws Exception { - SSLContext reservedSSLContext = SSLContext.getDefault(); - try { - long time = System.currentTimeMillis(); - String relPath; - if ((args != null) && (args.length > 0) && args[0].equals("sh")) { - relPath = pathToStoresSH; - } else { - relPath = pathToStores; - } - PATH = new File(System.getProperty("test.src", "."), relPath); - CipherTest.peerFactory = peerFactory; - System.out.print( - "Initializing test '" + peerFactory.getName() + "'..."); -// secureRandom = new SecureRandom(); -// secureRandom.nextInt(); -// trustStore = readKeyStore(trustStoreFile); - CipherTest.keyStore = keyStore; -// keyStore = readKeyStore(keyStoreFile); - KeyManagerFactory keyFactory = - KeyManagerFactory.getInstance( - KeyManagerFactory.getDefaultAlgorithm()); - keyFactory.init(keyStore, "test12".toCharArray()); - keyManager = (X509ExtendedKeyManager)keyFactory.getKeyManagers()[0]; + long time = System.currentTimeMillis(); + String relPath; + if ((args != null) && (args.length > 0) && args[0].equals("sh")) { + relPath = pathToStoresSH; + } else { + relPath = pathToStores; + } + PATH = new File(System.getProperty("test.src", "."), relPath); + CipherTest.peerFactory = peerFactory; + System.out.print( + "Initializing test '" + peerFactory.getName() + "'..."); +// secureRandom = new SecureRandom(); +// secureRandom.nextInt(); +// trustStore = readKeyStore(trustStoreFile); + CipherTest.keyStore = keyStore; +// keyStore = readKeyStore(keyStoreFile); + KeyManagerFactory keyFactory = + KeyManagerFactory.getInstance( + KeyManagerFactory.getDefaultAlgorithm()); + keyFactory.init(keyStore, "test12".toCharArray()); + keyManager = (X509ExtendedKeyManager)keyFactory.getKeyManagers()[0]; - TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); - tmf.init(keyStore); - trustManager = (X509TrustManager)tmf.getTrustManagers()[0]; + TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + tmf.init(keyStore); + trustManager = (X509TrustManager)tmf.getTrustManagers()[0]; -// trustManager = new AlwaysTrustManager(); - SSLContext context = SSLContext.getInstance("TLS"); - context.init(new KeyManager[] {keyManager}, - new TrustManager[] {trustManager}, null); - SSLContext.setDefault(context); +// trustManager = new AlwaysTrustManager(); + SSLContext context = SSLContext.getInstance("TLS"); + context.init(new KeyManager[] {keyManager}, + new TrustManager[] {trustManager}, null); + SSLContext.setDefault(context); - CipherTest cipherTest = new CipherTest(peerFactory); - Thread serverThread = new Thread(peerFactory.newServer(cipherTest), - "Server"); - serverThread.setDaemon(true); - serverThread.start(); - System.out.println("Done"); - cipherTest.run(); - time = System.currentTimeMillis() - time; - System.out.println("Done. (" + time + " ms)"); - } finally { - SSLContext.setDefault(reservedSSLContext); - } + CipherTest cipherTest = new CipherTest(peerFactory); + Thread serverThread = new Thread(peerFactory.newServer(cipherTest), + "Server"); + serverThread.setDaemon(true); + serverThread.start(); + System.out.println("Done"); + cipherTest.run(); + time = System.currentTimeMillis() - time; + System.out.println("Done. (" + time + " ms)"); } static abstract class PeerFactory {
--- a/test/sun/security/pkcs11/fips/ClientJSSEServerJSSE.java Thu Oct 27 11:01:15 2011 -0400 +++ b/test/sun/security/pkcs11/fips/ClientJSSEServerJSSE.java Fri Oct 28 07:18:54 2011 -0700 @@ -26,9 +26,9 @@ * @bug 6313675 6323647 * @summary Verify that all ciphersuites work in FIPS mode * @library .. - * @run main/othervm ClientJSSEServerJSSE * @ignore JSSE supported cipher suites are changed with CR 6916074, * need to update this test case in JDK 7 soon + * @run main/othervm ClientJSSEServerJSSE * @author Andreas Sterbenz */