From 61681b39d95a238f837f91b550414fd109e7a7e4 Mon Sep 17 00:00:00 2001 From: weijun Date: Wed, 23 Oct 2013 08:32:03 +0800 Subject: [PATCH] 8027026: Change keytool -genkeypair to use -keyalg RSA Reviewed-by: alanb, chegar, mullan --- test/ProblemList.txt | 11 +---------- .../java/util/TimeZone/TimeZoneDatePermissionCheck.sh | 1 + .../util/jar/JarInputStream/ExtraFileInMetaInf.java | 2 +- test/sun/security/pkcs12/PKCS12SameKeyId.java | 2 +- test/sun/security/tools/jarsigner/TimestampCheck.java | 2 +- test/sun/security/tools/jarsigner/checkusage.sh | 2 +- test/sun/security/tools/jarsigner/collator.sh | 2 +- test/sun/security/tools/jarsigner/crl.sh | 2 +- test/sun/security/tools/jarsigner/jvindex.sh | 2 +- test/sun/security/tools/jarsigner/newsize7.sh | 2 +- test/sun/security/tools/jarsigner/onlymanifest.sh | 2 +- test/sun/security/tools/jarsigner/passtype.sh | 2 +- test/sun/security/tools/jarsigner/samename.sh | 2 +- test/sun/security/tools/jarsigner/ts.sh | 2 +- test/sun/security/tools/keytool/CloseFile.java | 2 +- test/sun/security/tools/keytool/ListKeychainStore.sh | 1 + test/sun/security/tools/keytool/StartDateTest.java | 2 +- .../security/tools/keytool/UnknownAndUnparseable.java | 2 +- test/sun/security/tools/keytool/emptysubject.sh | 2 +- test/sun/security/tools/keytool/importreadall.sh | 2 +- test/sun/security/tools/keytool/p12importks.sh | 4 ++-- test/sun/security/tools/keytool/readjar.sh | 2 +- test/sun/security/tools/keytool/selfissued.sh | 2 +- test/sun/security/tools/keytool/trystore.sh | 2 +- test/sun/security/validator/certreplace.sh | 2 +- test/sun/security/validator/samedn.sh | 2 +- 26 files changed, 27 insertions(+), 34 deletions(-) diff --git a/test/ProblemList.txt b/test/ProblemList.txt index a9eefed3b..07b8db70b 100644 --- a/test/ProblemList.txt +++ b/test/ProblemList.txt @@ -273,14 +273,8 @@ sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java solaris-all sun/security/pkcs11/Secmod/AddPrivateKey.java linux-all sun/security/pkcs11/Secmod/TrustAnchors.java linux-all -# 7041639, Solaris DSA keypair generation bug (Note: jdk_util also affected) +# 7041639, Solaris DSA keypair generation bug java/security/KeyPairGenerator/SolarisShortDSA.java solaris-all -sun/security/tools/jarsigner/onlymanifest.sh solaris-all -sun/security/tools/jarsigner/ts.sh solaris-all -sun/security/tools/keytool/emptysubject.sh solaris-all -sun/security/tools/keytool/importreadall.sh solaris-all -sun/security/tools/keytool/readjar.sh solaris-all -sun/security/tools/keytool/selfissued.sh solaris-all sun/security/tools/keytool/standard.sh solaris-all # 8000439: NPG: REGRESSION : sun/security/krb5/auto/MaxRetries.java fails with timeout @@ -351,7 +345,4 @@ java/util/concurrent/ThreadPoolExecutor/CoreThreadTimeOut.java generic-all # Filed 6772009 java/util/concurrent/locks/ReentrantLock/CancelledLockLoops.java generic-all -# 7041639, Solaris DSA keypair generation bug -java/util/TimeZone/TimeZoneDatePermissionCheck.sh solaris-all - ############################################################################ diff --git a/test/java/util/TimeZone/TimeZoneDatePermissionCheck.sh b/test/java/util/TimeZone/TimeZoneDatePermissionCheck.sh index ea40edfb0..44207ab35 100644 --- a/test/java/util/TimeZone/TimeZoneDatePermissionCheck.sh +++ b/test/java/util/TimeZone/TimeZoneDatePermissionCheck.sh @@ -40,6 +40,7 @@ rm -f ${TESTCLASSES}/timezonedatetest.store ${COMPILEJAVA}/bin/keytool ${TESTTOOLVMOPTS} -genkeypair -alias testcert \ -keystore ${TESTCLASSES}/timezonedatetest.store \ -storepass testpass -validity 360 \ + -keyalg rsa \ -dname "cn=Mark Wildebeest, ou=FreeSoft, o=Red Hat, c=NL" \ -keypass testpass diff --git a/test/java/util/jar/JarInputStream/ExtraFileInMetaInf.java b/test/java/util/jar/JarInputStream/ExtraFileInMetaInf.java index f55f4c483..6a062c6c2 100644 --- a/test/java/util/jar/JarInputStream/ExtraFileInMetaInf.java +++ b/test/java/util/jar/JarInputStream/ExtraFileInMetaInf.java @@ -49,7 +49,7 @@ public class ExtraFileInMetaInf { new File("ks").delete(); sun.security.tools.keytool.Main.main( ("-keystore ks -storepass changeit -keypass changeit " + - "-alias a -dname CN=A -genkeypair").split(" ")); + "-keyalg rsa -alias a -dname CN=A -genkeypair").split(" ")); sun.security.tools.jarsigner.Main.main( "-keystore ks -storepass changeit x.jar a".split(" ")); diff --git a/test/sun/security/pkcs12/PKCS12SameKeyId.java b/test/sun/security/pkcs12/PKCS12SameKeyId.java index f65292aeb..400ba0e9e 100644 --- a/test/sun/security/pkcs12/PKCS12SameKeyId.java +++ b/test/sun/security/pkcs12/PKCS12SameKeyId.java @@ -60,7 +60,7 @@ public class PKCS12SameKeyId { for (int i=0; i /dev/null diff --git a/test/sun/security/tools/jarsigner/jvindex.sh b/test/sun/security/tools/jarsigner/jvindex.sh index c4435b681..7c8ebdd7c 100644 --- a/test/sun/security/tools/jarsigner/jvindex.sh +++ b/test/sun/security/tools/jarsigner/jvindex.sh @@ -47,7 +47,7 @@ KS=jvindex.jks JFILE=jvindex.jar KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit \ - -keystore $KS" + -keystore $KS -keyalg rsa" JAR=$TESTJAVA${FS}bin${FS}jar JARSIGNER="$TESTJAVA${FS}bin${FS}jarsigner -keystore $KS -storepass changeit" diff --git a/test/sun/security/tools/jarsigner/newsize7.sh b/test/sun/security/tools/jarsigner/newsize7.sh index cb887c2ea..27ac5b938 100644 --- a/test/sun/security/tools/jarsigner/newsize7.sh +++ b/test/sun/security/tools/jarsigner/newsize7.sh @@ -51,7 +51,7 @@ esac KSFILE=ns7.jks -KT="${TESTJAVA}${FS}bin${FS}keytool -keystore ns7.jks -storepass changeit -keypass changeit" +KT="${TESTJAVA}${FS}bin${FS}keytool -keystore ns7.jks -storepass changeit -keypass changeit -keyalg rsa" JAR="${TESTJAVA}${FS}bin${FS}jar" JS="${TESTJAVA}${FS}bin${FS}jarsigner -keystore ns7.jks -storepass changeit" diff --git a/test/sun/security/tools/jarsigner/onlymanifest.sh b/test/sun/security/tools/jarsigner/onlymanifest.sh index 5ea95784b..16e7d7737 100644 --- a/test/sun/security/tools/jarsigner/onlymanifest.sh +++ b/test/sun/security/tools/jarsigner/onlymanifest.sh @@ -46,7 +46,7 @@ KS=onlymanifest.jks JFILE=onlymanifest.jar KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit \ - -keystore $KS" + -keystore $KS -keyalg rsa" JAR=$TESTJAVA${FS}bin${FS}jar JARSIGNER=$TESTJAVA${FS}bin${FS}jarsigner diff --git a/test/sun/security/tools/jarsigner/passtype.sh b/test/sun/security/tools/jarsigner/passtype.sh index b649668cb..c3ce7d5aa 100644 --- a/test/sun/security/tools/jarsigner/passtype.sh +++ b/test/sun/security/tools/jarsigner/passtype.sh @@ -45,7 +45,7 @@ esac KS=pt.jks JFILE=pt.jar -KT="$TESTJAVA${FS}bin${FS}keytool -keystore $KS -validity 300" +KT="$TESTJAVA${FS}bin${FS}keytool -keystore $KS -validity 300 -keyalg rsa" JAR=$TESTJAVA${FS}bin${FS}jar JARSIGNER=$TESTJAVA${FS}bin${FS}jarsigner diff --git a/test/sun/security/tools/jarsigner/samename.sh b/test/sun/security/tools/jarsigner/samename.sh index 2b9203e72..a89caa10c 100644 --- a/test/sun/security/tools/jarsigner/samename.sh +++ b/test/sun/security/tools/jarsigner/samename.sh @@ -47,7 +47,7 @@ esac KS=samename.jks JFILE=em.jar -KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit -keystore $KS" +KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit -keystore $KS -keyalg rsa" JAR=$TESTJAVA${FS}bin${FS}jar JARSIGNER=$TESTJAVA${FS}bin${FS}jarsigner diff --git a/test/sun/security/tools/jarsigner/ts.sh b/test/sun/security/tools/jarsigner/ts.sh index e318ca677..b38922692 100644 --- a/test/sun/security/tools/jarsigner/ts.sh +++ b/test/sun/security/tools/jarsigner/ts.sh @@ -53,7 +53,7 @@ fi JAR="${TESTJAVA}${FS}bin${FS}jar" JAVA="${TESTJAVA}${FS}bin${FS}java" JAVAC="${TESTJAVA}${FS}bin${FS}javac" -KT="${TESTJAVA}${FS}bin${FS}keytool -keystore tsks -storepass changeit -keypass changeit" +KT="${TESTJAVA}${FS}bin${FS}keytool -keystore tsks -storepass changeit -keypass changeit -keyalg rsa" rm tsks echo Nothing > A diff --git a/test/sun/security/tools/keytool/CloseFile.java b/test/sun/security/tools/keytool/CloseFile.java index 82c3e44a1..95fd4c258 100644 --- a/test/sun/security/tools/keytool/CloseFile.java +++ b/test/sun/security/tools/keytool/CloseFile.java @@ -59,7 +59,7 @@ public class CloseFile { } static void run(String s) throws Exception { - sun.security.tools.keytool.Main.main((s+" -debug").split(" ")); + sun.security.tools.keytool.Main.main((s+" -debug -keyalg rsa").split(" ")); } static void remove(String filename, boolean check) { new File(filename).delete(); diff --git a/test/sun/security/tools/keytool/ListKeychainStore.sh b/test/sun/security/tools/keytool/ListKeychainStore.sh index 63fb0f870..48b1a5ebf 100644 --- a/test/sun/security/tools/keytool/ListKeychainStore.sh +++ b/test/sun/security/tools/keytool/ListKeychainStore.sh @@ -71,6 +71,7 @@ do -storetype PKCS12 \ -keystore $TEMPORARY_P12 \ -storepass $PWD \ + -keyalg rsa \ -dname "CN=$i,OU=$i,O=$i,ST=$i,C=US" \ -alias 7133495-$i diff --git a/test/sun/security/tools/keytool/StartDateTest.java b/test/sun/security/tools/keytool/StartDateTest.java index 597c74510..96282a024 100644 --- a/test/sun/security/tools/keytool/StartDateTest.java +++ b/test/sun/security/tools/keytool/StartDateTest.java @@ -49,7 +49,7 @@ public class StartDateTest { new File("jks").delete(); run("-keystore jks -storetype jks -storepass changeit -keypass changeit -alias me " + - "-genkeypair -dname CN=Haha -startdate +1y"); + "-keyalg rsa -genkeypair -dname CN=Haha -startdate +1y"); cal.setTime(getIssueDate()); System.out.println(cal); if (cal.get(Calendar.YEAR) != year + 1) { diff --git a/test/sun/security/tools/keytool/UnknownAndUnparseable.java b/test/sun/security/tools/keytool/UnknownAndUnparseable.java index cb8cbad41..7c72a4dbd 100644 --- a/test/sun/security/tools/keytool/UnknownAndUnparseable.java +++ b/test/sun/security/tools/keytool/UnknownAndUnparseable.java @@ -43,7 +43,7 @@ public class UnknownAndUnparseable { // Create a cert with an unknown extension: 1.2.3.4, and an invalid // KeyUsage extension String genkey = s - + "-genkeypair -alias a -dname CN=A -ext 1.2.3.4=1234 " + + "-genkeypair -alias a -dname CN=A -ext 1.2.3.4=1234 -keyalg rsa " + "-ext " + PKIXExtensions.KeyUsage_Id.toString() + "=5678"; sun.security.tools.keytool.Main.main(genkey.split(" ")); diff --git a/test/sun/security/tools/keytool/emptysubject.sh b/test/sun/security/tools/keytool/emptysubject.sh index 3d9ca0626..19b61f8ac 100644 --- a/test/sun/security/tools/keytool/emptysubject.sh +++ b/test/sun/security/tools/keytool/emptysubject.sh @@ -45,7 +45,7 @@ case "$OS" in esac KS=emptysubject.jks -KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit -keystore $KS" +KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit -keystore $KS -keyalg rsa" rm $KS diff --git a/test/sun/security/tools/keytool/importreadall.sh b/test/sun/security/tools/keytool/importreadall.sh index cbf67c156..6a223dedc 100644 --- a/test/sun/security/tools/keytool/importreadall.sh +++ b/test/sun/security/tools/keytool/importreadall.sh @@ -49,7 +49,7 @@ case "$OS" in ;; esac -KEYTOOL="${TESTJAVA}${FS}bin${FS}keytool -keystore importreadall.jks -storepass changeit -keypass changeit" +KEYTOOL="${TESTJAVA}${FS}bin${FS}keytool -keystore importreadall.jks -storepass changeit -keypass changeit -keyalg rsa" # In case the test is run twice in the same directory diff --git a/test/sun/security/tools/keytool/p12importks.sh b/test/sun/security/tools/keytool/p12importks.sh index efdb56a34..33462b27f 100644 --- a/test/sun/security/tools/keytool/p12importks.sh +++ b/test/sun/security/tools/keytool/p12importks.sh @@ -50,7 +50,7 @@ KT=$TESTJAVA${FS}bin${FS}keytool rm jks 2> /dev/null $KT -genkeypair -keystore jks -storetype jks -alias me -dname CN=Me \ - -storepass pass1111 -keypass pass1111 || exit 11 + -keyalg rsa -storepass pass1111 -keypass pass1111 || exit 11 # Cannot only change storepass rm p12 2> /dev/null @@ -85,7 +85,7 @@ $KT -certreq -storetype pkcs12 -keystore p12 -alias me \ rm jks 2> /dev/null $KT -genkeypair -keystore jks -storetype jks -alias me -dname CN=Me \ - -storepass pass1111 -keypass pass2222 || exit 21 + -keyalg rsa -storepass pass1111 -keypass pass2222 || exit 21 # Can use old keypass as new storepass so new storepass and keypass are same rm p12 2> /dev/null diff --git a/test/sun/security/tools/keytool/readjar.sh b/test/sun/security/tools/keytool/readjar.sh index 037a90818..31324a63a 100644 --- a/test/sun/security/tools/keytool/readjar.sh +++ b/test/sun/security/tools/keytool/readjar.sh @@ -46,7 +46,7 @@ esac KS=readjar.jks rm $KS $TESTJAVA${FS}bin${FS}keytool ${TESTTOOLVMOPTS} -storepass changeit -keypass changeit -keystore $KS \ - -alias x -dname CN=X -genkeypair + -keyalg rsa -alias x -dname CN=X -genkeypair $COMPILEJAVA${FS}bin${FS}jar ${TESTTOOLVMOPTS} cvf readjar.jar $KS $COMPILEJAVA${FS}bin${FS}jarsigner ${TESTTOOLVMOPTS} -storepass changeit -keystore $KS readjar.jar x diff --git a/test/sun/security/tools/keytool/selfissued.sh b/test/sun/security/tools/keytool/selfissued.sh index 4fa7cfc42..c02c66a1b 100644 --- a/test/sun/security/tools/keytool/selfissued.sh +++ b/test/sun/security/tools/keytool/selfissued.sh @@ -45,7 +45,7 @@ case "$OS" in esac KS=selfsigned.jks -KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit -keystore $KS" +KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit -keystore $KS -keyalg rsa" rm $KS diff --git a/test/sun/security/tools/keytool/trystore.sh b/test/sun/security/tools/keytool/trystore.sh index ffe4ebe73..2dcf9885e 100644 --- a/test/sun/security/tools/keytool/trystore.sh +++ b/test/sun/security/tools/keytool/trystore.sh @@ -43,7 +43,7 @@ esac rm trystore.jks 2> /dev/null -KEYTOOL="${TESTJAVA}${FS}bin${FS}keytool -storetype jks -keystore trystore.jks" +KEYTOOL="${TESTJAVA}${FS}bin${FS}keytool -storetype jks -keystore trystore.jks -keyalg rsa" $KEYTOOL -genkeypair -alias a -dname CN=A -storepass changeit -keypass changeit $KEYTOOL -genkeypair -alias b -dname CN=B -storepass changeit -keypass changeit diff --git a/test/sun/security/validator/certreplace.sh b/test/sun/security/validator/certreplace.sh index 78f821bf1..510483380 100644 --- a/test/sun/security/validator/certreplace.sh +++ b/test/sun/security/validator/certreplace.sh @@ -48,7 +48,7 @@ case "$OS" in esac KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit \ - -keypass changeit -keystore certreplace.jks" + -keypass changeit -keystore certreplace.jks -keyalg rsa" JAVAC=$COMPILEJAVA${FS}bin${FS}javac JAVA=$TESTJAVA${FS}bin${FS}java diff --git a/test/sun/security/validator/samedn.sh b/test/sun/security/validator/samedn.sh index 0e3e83708..17d5af23b 100644 --- a/test/sun/security/validator/samedn.sh +++ b/test/sun/security/validator/samedn.sh @@ -48,7 +48,7 @@ case "$OS" in esac KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit \ - -keypass changeit -keystore samedn.jks" + -keypass changeit -keystore samedn.jks -keyalg rsa" JAVAC=$COMPILEJAVA${FS}bin${FS}javac JAVA=$TESTJAVA${FS}bin${FS}java -- GitLab