author | xuelei |
Mon, 25 Jun 2018 13:41:39 -0700 | |
changeset 50768 | 68fa3d4026ea |
parent 47216 | 71c04702a3d5 |
child 51460 | 97e361fe3433 |
permissions | -rw-r--r-- |
2 | 1 |
# |
36511 | 2 |
# Copyright (c) 2003, 2015, 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 |
||
24 |
# @test |
|
11521
d7698e6c5f51
7106773: 512 bits RSA key cannot work with SHA384 and SHA512
xuelei
parents:
5506
diff
changeset
|
25 |
# @bug 4938185 7106773 |
2 | 26 |
# @summary KeyStore support for NSS cert/key databases |
11521
d7698e6c5f51
7106773: 512 bits RSA key cannot work with SHA384 and SHA512
xuelei
parents:
5506
diff
changeset
|
27 |
# 512 bits RSA key cannot work with SHA384 and SHA512 |
2 | 28 |
# |
29 |
# @run shell ClientAuth.sh |
|
30 |
||
31 |
# set a few environment variables so that the shell-script can run stand-alone |
|
32 |
# in the source directory |
|
33 |
||
34 |
if [ "${TESTSRC}" = "" ] ; then |
|
35 |
TESTSRC=`pwd` |
|
36 |
fi |
|
37 |
if [ "${TESTCLASSES}" = "" ] ; then |
|
38 |
TESTCLASSES=`pwd` |
|
39 |
fi |
|
40 |
if [ "${TESTJAVA}" = "" ] ; then |
|
41 |
TESTJAVA="/net/radiant/export1/charlie/mustang/build/solaris-sparc" |
|
42 |
fi |
|
15254
3997a6f357cb
8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents:
14786
diff
changeset
|
43 |
if [ "${COMPILEJAVA}" = "" ]; then |
3997a6f357cb
8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents:
14786
diff
changeset
|
44 |
COMPILEJAVA="${TESTJAVA}" |
3997a6f357cb
8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents:
14786
diff
changeset
|
45 |
fi |
2 | 46 |
echo TESTSRC=${TESTSRC} |
47 |
echo TESTCLASSES=${TESTCLASSES} |
|
48 |
echo TESTJAVA=${TESTJAVA} |
|
15254
3997a6f357cb
8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents:
14786
diff
changeset
|
49 |
echo COMPILEJAVA=${COMPILEJAVA} |
2 | 50 |
echo "" |
51 |
||
52 |
OS=`uname -s` |
|
53 |
case "$OS" in |
|
54 |
SunOS ) |
|
55 |
ARCH=`isainfo` |
|
56 |
case "$ARCH" in |
|
57 |
sparc* ) |
|
50768 | 58 |
FS="/" |
59 |
PS=":" |
|
60 |
CP="${FS}bin${FS}cp" |
|
61 |
CHMOD="${FS}bin${FS}chmod" |
|
62 |
;; |
|
2 | 63 |
i[3-6]86 ) |
50768 | 64 |
FS="/" |
65 |
PS=":" |
|
66 |
CP="${FS}bin${FS}cp" |
|
67 |
CHMOD="${FS}bin${FS}chmod" |
|
68 |
;; |
|
2 | 69 |
amd64* ) |
50768 | 70 |
FS="/" |
71 |
PS=":" |
|
72 |
CP="${FS}bin${FS}cp" |
|
73 |
CHMOD="${FS}bin${FS}chmod" |
|
74 |
;; |
|
2 | 75 |
* ) |
76 |
# ?itanium? ) |
|
77 |
# amd64* ) |
|
50768 | 78 |
echo "Unsupported System: Solaris ${ARCH}" |
79 |
exit 0; |
|
80 |
;; |
|
2 | 81 |
esac |
82 |
;; |
|
83 |
Linux ) |
|
84 |
ARCH=`uname -m` |
|
85 |
case "$ARCH" in |
|
86 |
i[3-6]86 ) |
|
50768 | 87 |
FS="/" |
88 |
PS=":" |
|
89 |
CP="${FS}bin${FS}cp" |
|
90 |
CHMOD="${FS}bin${FS}chmod" |
|
91 |
;; |
|
2 | 92 |
* ) |
93 |
# ia64 ) |
|
94 |
# x86_64 ) |
|
50768 | 95 |
echo "Unsupported System: Linux ${ARCH}" |
96 |
exit 0; |
|
97 |
;; |
|
2 | 98 |
esac |
99 |
;; |
|
100 |
Windows* ) |
|
101 |
FS="\\" |
|
102 |
PS=";" |
|
103 |
CP="cp" |
|
104 |
CHMOD="chmod" |
|
105 |
||
106 |
# 'uname -m' does not give us enough information - |
|
107 |
# should rely on $PROCESSOR_IDENTIFIER (as is done in Defs-windows.gmk), |
|
108 |
# but JTREG does not pass this env variable when executing a shell script. |
|
109 |
# |
|
110 |
# execute test program - rely on it to exit if platform unsupported |
|
111 |
||
112 |
;; |
|
113 |
* ) |
|
114 |
echo "Unsupported System: ${OS}" |
|
115 |
exit 0; |
|
116 |
;; |
|
117 |
esac |
|
118 |
||
119 |
# first make cert/key DBs writable |
|
120 |
||
121 |
${CP} ${TESTSRC}${FS}ClientAuthData${FS}cert8.db ${TESTCLASSES} |
|
122 |
${CHMOD} +w ${TESTCLASSES}${FS}cert8.db |
|
123 |
||
124 |
${CP} ${TESTSRC}${FS}ClientAuthData${FS}key3.db ${TESTCLASSES} |
|
125 |
${CHMOD} +w ${TESTCLASSES}${FS}key3.db |
|
126 |
||
127 |
# compile test |
|
15254
3997a6f357cb
8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents:
14786
diff
changeset
|
128 |
${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \ |
50768 | 129 |
-classpath ${TESTSRC} \ |
130 |
-d ${TESTCLASSES} \ |
|
131 |
${TESTSRC}${FS}ClientAuth.java \ |
|
132 |
${TESTSRC}${FS}..${FS}PKCS11Test.java |
|
2 | 133 |
|
134 |
# run test |
|
50768 | 135 |
echo "Run ClientAuth TLSv1 ..." |
14786
a9f61e0cbe61
8003890: corelibs test scripts should pass TESTVMOPTS
chegar
parents:
11521
diff
changeset
|
136 |
${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} \ |
50768 | 137 |
-classpath ${TESTCLASSES} \ |
138 |
-DDIR=${TESTSRC}${FS}ClientAuthData${FS} \ |
|
139 |
-DCUSTOM_DB_DIR=${TESTCLASSES} \ |
|
140 |
-DCUSTOM_P11_CONFIG=${TESTSRC}${FS}ClientAuthData${FS}p11-nss.txt \ |
|
141 |
-DNO_DEFAULT=true \ |
|
142 |
-DNO_DEIMOS=true \ |
|
143 |
-Dtest.src=${TESTSRC} \ |
|
144 |
-Dtest.classes=${TESTCLASSES} \ |
|
145 |
ClientAuth TLSv1 |
|
146 |
||
147 |
# save error status |
|
148 |
status=$? |
|
149 |
||
150 |
# return if failed |
|
151 |
if [ "${status}" != "0" ] ; then |
|
152 |
exit $status |
|
153 |
fi |
|
154 |
||
155 |
# run test |
|
156 |
echo "Run ClientAuth TLSv1.1 ..." |
|
157 |
${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} \ |
|
158 |
-classpath ${TESTCLASSES} \ |
|
159 |
-DDIR=${TESTSRC}${FS}ClientAuthData${FS} \ |
|
160 |
-DCUSTOM_DB_DIR=${TESTCLASSES} \ |
|
161 |
-DCUSTOM_P11_CONFIG=${TESTSRC}${FS}ClientAuthData${FS}p11-nss.txt \ |
|
162 |
-DNO_DEFAULT=true \ |
|
163 |
-DNO_DEIMOS=true \ |
|
164 |
-Dtest.src=${TESTSRC} \ |
|
165 |
-Dtest.classes=${TESTCLASSES} \ |
|
166 |
ClientAuth TLSv1.1 |
|
2 | 167 |
|
168 |
# save error status |
|
169 |
status=$? |
|
170 |
||
11521
d7698e6c5f51
7106773: 512 bits RSA key cannot work with SHA384 and SHA512
xuelei
parents:
5506
diff
changeset
|
171 |
# return if failed |
d7698e6c5f51
7106773: 512 bits RSA key cannot work with SHA384 and SHA512
xuelei
parents:
5506
diff
changeset
|
172 |
if [ "${status}" != "0" ] ; then |
d7698e6c5f51
7106773: 512 bits RSA key cannot work with SHA384 and SHA512
xuelei
parents:
5506
diff
changeset
|
173 |
exit $status |
d7698e6c5f51
7106773: 512 bits RSA key cannot work with SHA384 and SHA512
xuelei
parents:
5506
diff
changeset
|
174 |
fi |
d7698e6c5f51
7106773: 512 bits RSA key cannot work with SHA384 and SHA512
xuelei
parents:
5506
diff
changeset
|
175 |
|
d7698e6c5f51
7106773: 512 bits RSA key cannot work with SHA384 and SHA512
xuelei
parents:
5506
diff
changeset
|
176 |
# run test with specified TLS protocol and cipher suite |
d7698e6c5f51
7106773: 512 bits RSA key cannot work with SHA384 and SHA512
xuelei
parents:
5506
diff
changeset
|
177 |
echo "Run ClientAuth TLSv1.2 TLS_DHE_RSA_WITH_AES_128_CBC_SHA" |
14786
a9f61e0cbe61
8003890: corelibs test scripts should pass TESTVMOPTS
chegar
parents:
11521
diff
changeset
|
178 |
${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} \ |
50768 | 179 |
-classpath ${TESTCLASSES} \ |
180 |
-DDIR=${TESTSRC}${FS}ClientAuthData${FS} \ |
|
181 |
-DCUSTOM_DB_DIR=${TESTCLASSES} \ |
|
182 |
-DCUSTOM_P11_CONFIG=${TESTSRC}${FS}ClientAuthData${FS}p11-nss.txt \ |
|
183 |
-DNO_DEFAULT=true \ |
|
184 |
-DNO_DEIMOS=true \ |
|
185 |
-Dtest.src=${TESTSRC} \ |
|
186 |
-Dtest.classes=${TESTCLASSES} \ |
|
187 |
ClientAuth TLSv1.2 TLS_DHE_RSA_WITH_AES_128_CBC_SHA |
|
11521
d7698e6c5f51
7106773: 512 bits RSA key cannot work with SHA384 and SHA512
xuelei
parents:
5506
diff
changeset
|
188 |
|
d7698e6c5f51
7106773: 512 bits RSA key cannot work with SHA384 and SHA512
xuelei
parents:
5506
diff
changeset
|
189 |
# save error status |
d7698e6c5f51
7106773: 512 bits RSA key cannot work with SHA384 and SHA512
xuelei
parents:
5506
diff
changeset
|
190 |
status=$? |
d7698e6c5f51
7106773: 512 bits RSA key cannot work with SHA384 and SHA512
xuelei
parents:
5506
diff
changeset
|
191 |
|
2 | 192 |
# return |
193 |
exit $status |