jdk/test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh
author ohair
Tue, 25 May 2010 15:58:33 -0700
changeset 5506 202f599c92aa
parent 291 be2e0a87d658
child 10332 9037c51ae512
permissions -rw-r--r--
6943119: Rebrand source copyright notices Reviewed-by: darcy, weijun
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
291
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
     1
#
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 291
diff changeset
     2
# Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
291
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
     4
#
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
     7
# published by the Free Software Foundation.
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
     8
#
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
     9
# This code is distributed in the hope that it will be useful, but WITHOUT
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    10
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    11
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    12
# version 2 for more details (a copy is included in the LICENSE file that
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    13
# accompanied this code).
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    14
#
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    15
# You should have received a copy of the GNU General Public License version
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    16
# 2 along with this work; if not, write to the Free Software Foundation,
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    17
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    18
#
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 291
diff changeset
    19
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 291
diff changeset
    20
# or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 291
diff changeset
    21
# questions.
291
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    22
#
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    23
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    24
# @test
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    25
# @bug 6599979
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    26
# @summary Ensure that re-assigning the alias works
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    27
#
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    28
# @run shell SecretKeysBasic.sh
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    29
#
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    30
# To run by hand:
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    31
#    %sh SecretKeysBasic.sh
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    32
#
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    33
# Note:
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    34
#    . test only runs on solaris at the moment
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    35
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    36
# set a few environment variables so that the shell-script can run stand-alone
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    37
# in the source directory
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    38
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    39
# if running by hand on windows, change TESTSRC and TESTCLASSES to "."
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    40
if [ "${TESTSRC}" = "" ] ; then
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    41
    TESTSRC=`pwd`
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    42
fi
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    43
if [ "${TESTCLASSES}" = "" ] ; then
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    44
    TESTCLASSES=`pwd`
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    45
fi
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    46
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    47
# if running by hand on windows, change this to appropriate value
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    48
if [ "${TESTJAVA}" = "" ] ; then
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    49
    TESTJAVA="/net/shimmer/export/valeriep/jdk7/build/solaris-sparc"
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    50
fi
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    51
echo TESTSRC=${TESTSRC}
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    52
echo TESTCLASSES=${TESTCLASSES}
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    53
echo TESTJAVA=${TESTJAVA}
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    54
echo ""
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    55
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    56
#DEBUG=sunpkcs11,pkcs11keystore
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    57
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    58
echo DEBUG=${DEBUG}
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    59
echo ""
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    60
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    61
OS=`uname -s`
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    62
case "$OS" in
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    63
  SunOS )
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    64
    FS="/"
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    65
    PS=":"
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    66
    SCCS="${FS}usr${FS}ccs${FS}bin${FS}sccs"
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    67
    CP="${FS}bin${FS}cp -f"
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    68
    RM="${FS}bin${FS}rm -rf"
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    69
    MKDIR="${FS}bin${FS}mkdir -p"
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    70
    CHMOD="${FS}bin${FS}chmod"
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    71
    ;;
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    72
  * )
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    73
    echo "Unsupported System ${OS} - Test only runs on Solaris"
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    74
    exit 0;
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    75
    ;;
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    76
esac
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    77
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    78
TOKENS="nss solaris"
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    79
STATUS=0
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    80
for token in ${TOKENS}
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    81
do
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    82
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    83
if [ ${token} = "nss" ]
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    84
then
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    85
    # make cert/key DBs writable if token is NSS
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    86
    ${CP} ${TESTSRC}${FS}..${FS}nss${FS}db${FS}cert8.db ${TESTCLASSES}
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    87
    ${CHMOD} +w ${TESTCLASSES}${FS}cert8.db
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    88
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    89
    ${CP} ${TESTSRC}${FS}..${FS}nss${FS}db${FS}key3.db ${TESTCLASSES}
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    90
    ${CHMOD} +w ${TESTCLASSES}${FS}key3.db
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    91
    USED_FILE_LIST="${TESTCLASSES}${FS}cert8.db ${TESTCLASSES}${FS}key3.db"
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    92
elif [ ${token} = "solaris" ]
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    93
then
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    94
    OS_VERSION=`uname -r`
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    95
    case "${OS_VERSION}" in
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    96
      5.1* )
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    97
        SOFTTOKEN_DIR=${TESTCLASSES}
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    98
        export SOFTTOKEN_DIR
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
    99
        ;;
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   100
      * )
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   101
        echo "Unsupported Version ${OS_VERSION} - Test only runs on Solaris"
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   102
        exit 0;
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   103
        ;;
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   104
    esac
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   105
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   106
    # copy keystore into write-able location
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   107
    if [ -d ${TESTCLASSES}${FS}pkcs11_softtoken ]
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   108
    then
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   109
        echo "Removing old pkcs11_keystore, creating new pkcs11_keystore"
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   110
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   111
        echo ${RM} ${TESTCLASSES}${FS}pkcs11_softtoken
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   112
        ${RM} ${TESTCLASSES}${FS}pkcs11_softtoken
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   113
    fi
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   114
    echo ${MKDIR} ${TESTCLASSES}${FS}pkcs11_softtoken${FS}private
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   115
    ${MKDIR} ${TESTCLASSES}${FS}pkcs11_softtoken${FS}private
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   116
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   117
    echo ${MKDIR} ${TESTCLASSES}${FS}pkcs11_softtoken${FS}public
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   118
    ${MKDIR} ${TESTCLASSES}${FS}pkcs11_softtoken${FS}public
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   119
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   120
    echo ${CP} ${TESTSRC}${FS}BasicData${FS}pkcs11_softtoken${FS}objstore_info \
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   121
	${TESTCLASSES}${FS}pkcs11_softtoken
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   122
    ${CP} ${TESTSRC}${FS}BasicData${FS}pkcs11_softtoken${FS}objstore_info \
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   123
	${TESTCLASSES}${FS}pkcs11_softtoken
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   124
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   125
    echo ${CHMOD} +w ${TESTCLASSES}${FS}pkcs11_softtoken${FS}objstore_info
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   126
    ${CHMOD} 600 ${TESTCLASSES}${FS}pkcs11_softtoken${FS}objstore_info
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   127
    USED_FILE_LIST="${TESTCLASSES}${FS}pkcs11_softtoken"
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   128
fi
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   129
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   130
cd ${TESTCLASSES}
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   131
${TESTJAVA}${FS}bin${FS}javac \
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   132
        -classpath ${TESTCLASSES} \
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   133
        -d ${TESTCLASSES} \
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   134
        ${TESTSRC}${FS}SecretKeysBasic.java
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   135
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   136
# run test
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   137
cd ${TESTSRC}
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   138
${TESTJAVA}${FS}bin${FS}java \
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   139
	-DDIR=${TESTSRC}${FS}BasicData${FS} \
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   140
        -classpath ${TESTCLASSES}${PS}${TESTSRC}${FS}loader.jar \
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   141
        -DCUSTOM_DB_DIR=${TESTCLASSES} \
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   142
        -DCUSTOM_P11_CONFIG=${TESTSRC}${FS}BasicData${FS}p11-${token}.txt \
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   143
	-DNO_DEFAULT=true \
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   144
	-DNO_DEIMOS=true \
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   145
	-DTOKEN=${token} \
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   146
	-Djava.security.debug=${DEBUG} \
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   147
	SecretKeysBasic
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   148
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   149
#	-DCUSTOM_P11_CONFIG=${TESTSRC}${FS}BasicData${FS}p11-${token}.txt \
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   150
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   151
# save error status
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   152
if [ $? != 0 ]
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   153
then
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   154
    echo "Test against " ${token} " Failed!"
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   155
    STATUS=1
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   156
fi
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   157
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   158
# clean up
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   159
${RM} ${USED_FILE_LIST}
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   160
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   161
done
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   162
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   163
# return
be2e0a87d658 6599979: KeyStore.setEntry/setKeyEntry() do not override existing entry for secret key objects
valeriep
parents:
diff changeset
   164
exit ${STATUS}