author | xuelei |
Mon, 03 Nov 2014 08:30:18 +0000 | |
changeset 28555 | c7bf34f7b215 |
parent 22268 | d72c97c708ae |
child 31712 | e4d5230193da |
permissions | -rw-r--r-- |
2 | 1 |
/* |
28555 | 2 |
* Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. |
2 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
5506 | 19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
20 |
* or visit www.oracle.com if you need additional information or have any |
|
21 |
* questions. |
|
2 | 22 |
*/ |
23 |
||
14700 | 24 |
// |
25 |
// SunJSSE does not support dynamic system properties, no way to re-use |
|
26 |
// system properties in samevm/agentvm mode. |
|
27 |
// |
|
28 |
||
2 | 29 |
/* |
30 |
* @test |
|
31 |
* @bug 6405536 |
|
32 |
* @summary Verify that all ciphersuites work (incl. ECC using NSS crypto) |
|
33 |
* @author Andreas Sterbenz |
|
34 |
* @library .. |
|
10328 | 35 |
* @library ../../../../java/security/testlibrary |
14700 | 36 |
* @run main/othervm ClientJSSEServerJSSE |
2 | 37 |
*/ |
38 |
||
39 |
import java.security.*; |
|
40 |
||
41 |
public class ClientJSSEServerJSSE extends PKCS11Test { |
|
42 |
||
43 |
private static String[] cmdArgs; |
|
44 |
||
45 |
public static void main(String[] args) throws Exception { |
|
28555 | 46 |
// reset the security property to make sure that the algorithms |
47 |
// and keys used in this test are not disabled. |
|
48 |
Security.setProperty("jdk.tls.disabledAlgorithms", ""); |
|
49 |
||
2 | 50 |
cmdArgs = args; |
51 |
main(new ClientJSSEServerJSSE()); |
|
52 |
} |
|
53 |
||
54 |
public void main(Provider p) throws Exception { |
|
22268
d72c97c708ae
8030829: Add MD5 to jdk.certpath.disabledAlgorithms security property
xuelei
parents:
14700
diff
changeset
|
55 |
// MD5 is used in this test case, don't disable MD5 algorithm. |
d72c97c708ae
8030829: Add MD5 to jdk.certpath.disabledAlgorithms security property
xuelei
parents:
14700
diff
changeset
|
56 |
Security.setProperty( |
d72c97c708ae
8030829: Add MD5 to jdk.certpath.disabledAlgorithms security property
xuelei
parents:
14700
diff
changeset
|
57 |
"jdk.certpath.disabledAlgorithms", "MD2, RSA keySize < 1024"); |
d72c97c708ae
8030829: Add MD5 to jdk.certpath.disabledAlgorithms security property
xuelei
parents:
14700
diff
changeset
|
58 |
|
2 | 59 |
if (p.getService("KeyFactory", "EC") == null) { |
60 |
System.out.println("Provider does not support EC, skipping"); |
|
61 |
return; |
|
62 |
} |
|
10328 | 63 |
Providers.setAt(p, 1); |
2 | 64 |
CipherTest.main(new JSSEFactory(), cmdArgs); |
65 |
Security.removeProvider(p.getName()); |
|
66 |
} |
|
67 |
||
68 |
private static class JSSEFactory extends CipherTest.PeerFactory { |
|
69 |
||
70 |
String getName() { |
|
71 |
return "Client JSSE - Server JSSE"; |
|
72 |
} |
|
73 |
||
74 |
CipherTest.Client newClient(CipherTest cipherTest) throws Exception { |
|
75 |
return new JSSEClient(cipherTest); |
|
76 |
} |
|
77 |
||
78 |
CipherTest.Server newServer(CipherTest cipherTest) throws Exception { |
|
79 |
return new JSSEServer(cipherTest); |
|
80 |
} |
|
81 |
} |
|
82 |
} |