annotate test/sun/security/mscapi/PublicKeyInterop.sh @ 11258:44a6aa58f7b2

8139436: sun.security.mscapi.KeyStore might load incomplete data Reviewed-by: vinnie, weijun
author clanger
date Fri, 18 Dec 2015 08:25:27 +0800
parents ae5d04dbacd6
children
rev   line source
vinnie@4108 1 #!/bin/sh
vinnie@4108 2
vinnie@4108 3 #
clanger@11258 4 # Copyright (c) 2011, 2015 Oracle and/or its affiliates. All rights reserved.
vinnie@4108 5 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
vinnie@4108 6 #
vinnie@4108 7 # This code is free software; you can redistribute it and/or modify it
vinnie@4108 8 # under the terms of the GNU General Public License version 2 only, as
vinnie@4108 9 # published by the Free Software Foundation.
vinnie@4108 10 #
vinnie@4108 11 # This code is distributed in the hope that it will be useful, but WITHOUT
vinnie@4108 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
vinnie@4108 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
vinnie@4108 14 # version 2 for more details (a copy is included in the LICENSE file that
vinnie@4108 15 # accompanied this code).
vinnie@4108 16 #
vinnie@4108 17 # You should have received a copy of the GNU General Public License version
vinnie@4108 18 # 2 along with this work; if not, write to the Free Software Foundation,
vinnie@4108 19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
vinnie@4108 20 #
vinnie@4108 21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
vinnie@4108 22 # or visit www.oracle.com if you need additional information or have any
vinnie@4108 23 # questions.
vinnie@4108 24 #
vinnie@4108 25
vinnie@4108 26 # @test
vinnie@4108 27 # @bug 6888925
clanger@11258 28 # @requires os.family == "windows"
vinnie@4108 29 # @run shell PublicKeyInterop.sh
vinnie@4108 30 # @summary SunMSCAPI's Cipher can't use RSA public keys obtained from other
vinnie@4108 31 # sources.
vinnie@4108 32 #
vinnie@4108 33
vinnie@4108 34 # set a few environment variables so that the shell-script can run stand-alone
vinnie@4108 35 # in the source directory
vinnie@4108 36 if [ "${TESTSRC}" = "" ] ; then
vinnie@4108 37 TESTSRC="."
vinnie@4108 38 fi
vinnie@4108 39
vinnie@4108 40 if [ "${TESTCLASSES}" = "" ] ; then
vinnie@4108 41 TESTCLASSES="."
vinnie@4108 42 fi
vinnie@4108 43
vinnie@4108 44 if [ "${TESTJAVA}" = "" ] ; then
vinnie@4108 45 echo "TESTJAVA not set. Test cannot execute."
vinnie@4108 46 echo "FAILED!!!"
vinnie@4108 47 exit 1
vinnie@4108 48 fi
vinnie@4108 49
vinnie@4108 50 OS=`uname -s`
vinnie@4108 51 case "$OS" in
vinnie@4108 52 Windows* | CYGWIN* )
vinnie@4108 53
vinnie@4108 54 echo "Creating a temporary RSA keypair in the Windows-My store..."
vinnie@4108 55 ${TESTJAVA}/bin/keytool \
vinnie@4108 56 -genkeypair \
vinnie@4108 57 -storetype Windows-My \
vinnie@4108 58 -keyalg RSA \
vinnie@4108 59 -alias 6888925 \
vinnie@4108 60 -dname "cn=6888925,c=US" \
vinnie@4108 61 -noprompt
vinnie@4108 62
vinnie@4108 63 echo
vinnie@4108 64 echo "Running the test..."
vinnie@4108 65 ${TESTJAVA}/bin/javac -d . ${TESTSRC}\\PublicKeyInterop.java
chegar@6252 66 ${TESTJAVA}/bin/java ${TESTVMOPTS} PublicKeyInterop
vinnie@4108 67
vinnie@4108 68 rc=$?
vinnie@4108 69
vinnie@4108 70 echo
vinnie@4108 71 echo "Removing the temporary RSA keypair from the Windows-My store..."
vinnie@4108 72 ${TESTJAVA}/bin/keytool \
vinnie@4108 73 -delete \
vinnie@4108 74 -storetype Windows-My \
vinnie@4108 75 -alias 6888925
vinnie@4108 76
vinnie@4108 77 echo done.
vinnie@4108 78 exit $rc
vinnie@4108 79 ;;
vinnie@4108 80
vinnie@4108 81 * )
vinnie@4108 82 echo "This test is not intended for '$OS' - passing test"
vinnie@4108 83 exit 0
vinnie@4108 84 ;;
vinnie@4108 85 esac