--- a/jdk/test/sun/security/tools/keytool/ListKeychainStore.sh Tue Nov 11 11:29:20 2014 -0800
+++ b/jdk/test/sun/security/tools/keytool/ListKeychainStore.sh Tue Nov 11 20:11:34 2014 +0000
@@ -22,7 +22,7 @@
#
# @test
-# @bug 7133495 8041740 8062264
+# @bug 7133495 8041740 8062264 8046777
# @summary [macosx] KeyChain KeyStore implementation retrieves only one private key entry
if [ "${TESTJAVA}" = "" ] ; then
@@ -117,6 +117,26 @@
fi
echo "Imported keypairs from PKCS12 keystore into the keychain"
+# Generate a 2048-bit RSA keypair and import into the temporary keychain
+# (its private key is configured with non-default key usage settings)
+
+certtool c k=$TEMPORARY_KC <<EOF
+test
+r
+2048
+y
+b
+s
+y
+A
+US
+A
+A
+
+
+y
+EOF
+
# Adjust the keychain search order
echo "\"$TEMPORARY_KC\"" > $TEMPORARY_LIST
@@ -127,10 +147,11 @@
security list-keychains
# Recount the number of private key entries in the Keychain keystores
+# (3 private keys imported from PKCS12, 1 private key generated by 'certtool')
RECOUNT=`$KEYTOOL -list | grep PrivateKeyEntry | wc -l`
echo "Found $RECOUNT private key entries in the Keychain keystore"
-if [ $RECOUNT -lt `expr $COUNT + 3` ]; then
+if [ $RECOUNT -lt `expr $COUNT + 4` ]; then
echo "Error: expected >$COUNT private key entries in the Keychain keystores"
RESULT=`$CLEANUP_P12`
RESULT=`$CLEANUP_KC`
@@ -141,7 +162,7 @@
# Access controls have already been lowered (see 'security import ... -A' above)
${TESTJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . ${TESTSRC}/ExportPrivateKeyNoPwd.java || exit 6
-echo | ${TESTJAVA}/bin/java ${TESTVMOPTS} ExportPrivateKeyNoPwd x
+${TESTJAVA}/bin/java ${TESTVMOPTS} ExportPrivateKeyNoPwd x
if [ $? -ne 0 ]; then
echo "Error exporting private key from the temporary keychain"
RESULT=`$CLEANUP_P12`