changeset 6948:544e82c5a52d

8027026: Change keytool -genkeypair to use -keyalg RSA Reviewed-by: alanb, chegar, mullan
author weijun
date Wed, 23 Oct 2013 08:32:03 +0800
parents e1f33d3b7054
children 827bc20e8f61
files test/ProblemList.txt test/java/util/TimeZone/TimeZoneDatePermissionCheck.sh test/java/util/jar/JarInputStream/ExtraFileInMetaInf.java test/sun/security/pkcs12/PKCS12SameKeyId.java test/sun/security/tools/jarsigner/TimestampCheck.java test/sun/security/tools/jarsigner/checkusage.sh test/sun/security/tools/jarsigner/crl.sh test/sun/security/tools/jarsigner/jvindex.sh test/sun/security/tools/jarsigner/newsize7.sh test/sun/security/tools/jarsigner/onlymanifest.sh test/sun/security/tools/jarsigner/passtype.sh test/sun/security/tools/jarsigner/samename.sh test/sun/security/tools/jarsigner/ts.sh test/sun/security/tools/keytool/CloseFile.java test/sun/security/tools/keytool/ListKeychainStore.sh test/sun/security/tools/keytool/StartDateTest.java test/sun/security/tools/keytool/emptysubject.sh test/sun/security/tools/keytool/importreadall.sh test/sun/security/tools/keytool/readjar.sh test/sun/security/tools/keytool/selfissued.sh test/sun/security/tools/keytool/trystore.sh test/sun/security/validator/samedn.sh
diffstat 22 files changed, 22 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/test/ProblemList.txt	Tue Feb 18 16:00:33 2014 +0400
+++ b/test/ProblemList.txt	Wed Oct 23 08:32:03 2013 +0800
@@ -453,9 +453,6 @@
 # Problems on windows, jmap.exe hangs? (these run jmap), fails on Solaris 10 x86
 java/util/concurrent/locks/Lock/TimedAcquireLeak.java           generic-all
 
-# 7041639, Solaris DSA keypair generation bug
-java/util/TimeZone/TimeZoneDatePermissionCheck.sh               solaris-all
-
 # 8026772: test/sun/util/resources/TimeZone/Bug6317929.java failing
 sun/util/resources/TimeZone/Bug6317929.java                     generic-all
 
--- a/test/java/util/TimeZone/TimeZoneDatePermissionCheck.sh	Tue Feb 18 16:00:33 2014 +0400
+++ b/test/java/util/TimeZone/TimeZoneDatePermissionCheck.sh	Wed Oct 23 08:32:03 2013 +0800
@@ -36,6 +36,7 @@
 ${TESTJAVA}/bin/keytool -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
 
--- a/test/java/util/jar/JarInputStream/ExtraFileInMetaInf.java	Tue Feb 18 16:00:33 2014 +0400
+++ b/test/java/util/jar/JarInputStream/ExtraFileInMetaInf.java	Wed Oct 23 08:32:03 2013 +0800
@@ -49,7 +49,7 @@
         new File("ks").delete();
         sun.security.tools.KeyTool.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(
                 "-keystore ks -storepass changeit x.jar a".split(" "));
 
--- a/test/sun/security/pkcs12/PKCS12SameKeyId.java	Tue Feb 18 16:00:33 2014 +0400
+++ b/test/sun/security/pkcs12/PKCS12SameKeyId.java	Wed Oct 23 08:32:03 2013 +0800
@@ -59,7 +59,7 @@
         for (int i=0; i<SIZE; i++) {
             System.err.print(".");
             String cmd = "-keystore " + JKSFILE
-                    + " -storepass changeit -keypass changeit "
+                    + " -storepass changeit -keypass changeit -keyalg rsa "
                     + "-genkeypair -alias p" + i + " -dname CN=" + i;
             KeyTool.main(cmd.split(" "));
         }
--- a/test/sun/security/tools/jarsigner/TimestampCheck.java	Tue Feb 18 16:00:33 2014 +0400
+++ b/test/sun/security/tools/jarsigner/TimestampCheck.java	Wed Oct 23 08:32:03 2013 +0800
@@ -188,7 +188,7 @@
             DerOutputStream tstInfo2 = new DerOutputStream();
             tstInfo2.putOctetString(tstInfo.toByteArray());
 
-            Signature sig = Signature.getInstance("SHA1withDSA");
+            Signature sig = Signature.getInstance("SHA1withRSA");
             sig.initSign((PrivateKey)(ks.getKey(
                     alias, "changeit".toCharArray())));
             sig.update(tstInfo.toByteArray());
@@ -205,7 +205,7 @@
             SignerInfo signerInfo = new SignerInfo(
                     new X500Name(signer.getIssuerX500Principal().getName()),
                     signer.getSerialNumber(),
-                    aid, AlgorithmId.get("DSA"), sig.sign());
+                    aid, AlgorithmId.get("RSA"), sig.sign());
 
             SignerInfo[] signerInfos = {signerInfo};
             PKCS7 p7 =
--- a/test/sun/security/tools/jarsigner/checkusage.sh	Tue Feb 18 16:00:33 2014 +0400
+++ b/test/sun/security/tools/jarsigner/checkusage.sh	Wed Oct 23 08:32:03 2013 +0800
@@ -45,7 +45,7 @@
     ;;
 esac
 
-KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit"
+KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit -keyalg rsa"
 JAR=$TESTJAVA${FS}bin${FS}jar
 JARSIGNER="$TESTJAVA${FS}bin${FS}jarsigner"
 
--- a/test/sun/security/tools/jarsigner/crl.sh	Tue Feb 18 16:00:33 2014 +0400
+++ b/test/sun/security/tools/jarsigner/crl.sh	Wed Oct 23 08:32:03 2013 +0800
@@ -45,7 +45,7 @@
 
 KS=crl.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 2> /dev/null
 
--- a/test/sun/security/tools/jarsigner/jvindex.sh	Tue Feb 18 16:00:33 2014 +0400
+++ b/test/sun/security/tools/jarsigner/jvindex.sh	Wed Oct 23 08:32:03 2013 +0800
@@ -47,7 +47,7 @@
 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"
 
--- a/test/sun/security/tools/jarsigner/newsize7.sh	Tue Feb 18 16:00:33 2014 +0400
+++ b/test/sun/security/tools/jarsigner/newsize7.sh	Wed Oct 23 08:32:03 2013 +0800
@@ -51,7 +51,7 @@
 
 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"
 
--- a/test/sun/security/tools/jarsigner/onlymanifest.sh	Tue Feb 18 16:00:33 2014 +0400
+++ b/test/sun/security/tools/jarsigner/onlymanifest.sh	Wed Oct 23 08:32:03 2013 +0800
@@ -46,7 +46,7 @@
 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
 
--- a/test/sun/security/tools/jarsigner/passtype.sh	Tue Feb 18 16:00:33 2014 +0400
+++ b/test/sun/security/tools/jarsigner/passtype.sh	Wed Oct 23 08:32:03 2013 +0800
@@ -45,7 +45,7 @@
 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
 
--- a/test/sun/security/tools/jarsigner/samename.sh	Tue Feb 18 16:00:33 2014 +0400
+++ b/test/sun/security/tools/jarsigner/samename.sh	Wed Oct 23 08:32:03 2013 +0800
@@ -47,7 +47,7 @@
 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
 
--- a/test/sun/security/tools/jarsigner/ts.sh	Tue Feb 18 16:00:33 2014 +0400
+++ b/test/sun/security/tools/jarsigner/ts.sh	Wed Oct 23 08:32:03 2013 +0800
@@ -53,7 +53,7 @@
 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 -validity 200"
+KT="${TESTJAVA}${FS}bin${FS}keytool -keystore tsks -storepass changeit -keypass changeit -keyalg rsa -validity 200"
 
 rm tsks
 echo Nothing > A
--- a/test/sun/security/tools/keytool/CloseFile.java	Tue Feb 18 16:00:33 2014 +0400
+++ b/test/sun/security/tools/keytool/CloseFile.java	Wed Oct 23 08:32:03 2013 +0800
@@ -58,7 +58,7 @@
     }
 
     static void run(String s) throws Exception {
-        KeyTool.main((s+" -debug").split(" "));
+        KeyTool.main((s+" -debug -keyalg rsa").split(" "));
     }
     static void remove(String filename, boolean check) {
         new File(filename).delete();
--- a/test/sun/security/tools/keytool/ListKeychainStore.sh	Tue Feb 18 16:00:33 2014 +0400
+++ b/test/sun/security/tools/keytool/ListKeychainStore.sh	Wed Oct 23 08:32:03 2013 +0800
@@ -71,6 +71,7 @@
         -storetype PKCS12 \
         -keystore $TEMPORARY_P12 \
         -storepass $PWD \
+        -keyalg rsa \
         -dname "CN=$i,OU=$i,O=$i,ST=$i,C=US" \
         -alias 7133495-$i
 
--- a/test/sun/security/tools/keytool/StartDateTest.java	Tue Feb 18 16:00:33 2014 +0400
+++ b/test/sun/security/tools/keytool/StartDateTest.java	Wed Oct 23 08:32:03 2013 +0800
@@ -48,7 +48,7 @@
         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) {
--- a/test/sun/security/tools/keytool/emptysubject.sh	Tue Feb 18 16:00:33 2014 +0400
+++ b/test/sun/security/tools/keytool/emptysubject.sh	Wed Oct 23 08:32:03 2013 +0800
@@ -45,7 +45,7 @@
 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
 
--- a/test/sun/security/tools/keytool/importreadall.sh	Tue Feb 18 16:00:33 2014 +0400
+++ b/test/sun/security/tools/keytool/importreadall.sh	Wed Oct 23 08:32:03 2013 +0800
@@ -49,7 +49,7 @@
     ;;
 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
 
--- a/test/sun/security/tools/keytool/readjar.sh	Tue Feb 18 16:00:33 2014 +0400
+++ b/test/sun/security/tools/keytool/readjar.sh	Wed Oct 23 08:32:03 2013 +0800
@@ -45,7 +45,7 @@
 KS=readjar.jks
 rm $KS
 $TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit -keystore $KS \
-        -alias x -dname CN=X -genkeypair
+        -keyalg rsa -alias x -dname CN=X -genkeypair
 $TESTJAVA${FS}bin${FS}jar cvf readjar.jar $KS
 $TESTJAVA${FS}bin${FS}jarsigner -storepass changeit -keystore $KS readjar.jar x
 
--- a/test/sun/security/tools/keytool/selfissued.sh	Tue Feb 18 16:00:33 2014 +0400
+++ b/test/sun/security/tools/keytool/selfissued.sh	Wed Oct 23 08:32:03 2013 +0800
@@ -45,7 +45,7 @@
 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
 
--- a/test/sun/security/tools/keytool/trystore.sh	Tue Feb 18 16:00:33 2014 +0400
+++ b/test/sun/security/tools/keytool/trystore.sh	Wed Oct 23 08:32:03 2013 +0800
@@ -43,7 +43,7 @@
 
 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
 
--- a/test/sun/security/validator/samedn.sh	Tue Feb 18 16:00:33 2014 +0400
+++ b/test/sun/security/validator/samedn.sh	Wed Oct 23 08:32:03 2013 +0800
@@ -47,7 +47,7 @@
 esac
 
 KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit \
-    -keypass changeit -keystore samedn.jks"
+    -keypass changeit -keystore samedn.jks -keyalg rsa"
 JAVAC=$TESTJAVA${FS}bin${FS}javac
 JAVA=$TESTJAVA${FS}bin${FS}java