diff --git a/src/share/classes/java/lang/Character.java b/src/share/classes/java/lang/Character.java index 65a3fc401843dff86f7e9724edb87bd9064345fc..bc4284c20df9695b0a43d8f808b3b60b31a5c593 100644 --- a/src/share/classes/java/lang/Character.java +++ b/src/share/classes/java/lang/Character.java @@ -2587,9 +2587,9 @@ class Character extends Object implements java.io.Serializable, ComparableCharacter instance representing c. diff --git a/src/share/classes/sun/security/tools/JarSigner.java b/src/share/classes/sun/security/tools/JarSigner.java index fd0797a854d635f8e6985cefd4bb04c4605891de..c62018c99b090b9512e0f84a62d7747f5e46f0d8 100644 --- a/src/share/classes/sun/security/tools/JarSigner.java +++ b/src/share/classes/sun/security/tools/JarSigner.java @@ -1978,20 +1978,35 @@ public class JarSigner { String[] base64Digests = getDigests(ze, zf, digests, encoder); for (int i=0; i names = new ArrayList(asList(classesAnnotation.value())); - if (System.getProperty("java.runtime.name").startsWith("Java(TM)")) { - // Sun production JDK; test crypto classes too - for(String name: classesAnnotation.sunClasses()) - names.add(name); - } - int errs = 0; for(String name: names) { System.out.println("\nCLASS " + name); @@ -152,5 +134,4 @@ public class Probe { @Retention(RetentionPolicy.RUNTIME) @interface Classes { String [] value(); // list of classes to probe - String [] sunClasses(); // list of Sun-production JDK specific classes to probe } diff --git a/test/sun/security/tools/jarsigner/nameclash.sh b/test/sun/security/tools/jarsigner/nameclash.sh new file mode 100644 index 0000000000000000000000000000000000000000..bbb6ce7980d6e7d970c58d698b7ba0f670fbcbf7 --- /dev/null +++ b/test/sun/security/tools/jarsigner/nameclash.sh @@ -0,0 +1,66 @@ +# +# Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, +# CA 95054 USA or visit www.sun.com if you need additional information or +# have any questions. +# + +# @test +# @bug 6876328 +# @summary different names for the same digest algorithms breaks jarsigner +# + +if [ "${TESTJAVA}" = "" ] ; then + JAVAC_CMD=`which javac` + TESTJAVA=`dirname $JAVAC_CMD`/.. +fi + +# set platform-dependent variables +OS=`uname -s` +case "$OS" in + Windows_* ) + FS="\\" + ;; + * ) + FS="/" + ;; +esac + +KS=nc.jks +JFILE=nc.jar + +KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit -keystore $KS" +JAR=$TESTJAVA${FS}bin${FS}jar +JARSIGNER=$TESTJAVA${FS}bin${FS}jarsigner + +rm $KS $JFILE + +$KT -alias a -dname CN=a -keyalg rsa -genkey -validity 300 +$KT -alias b -dname CN=b -keyalg rsa -genkey -validity 300 + +echo A > A +$JAR cvf $JFILE A + +$JARSIGNER -keystore $KS -storepass changeit $JFILE a -digestalg SHA1 || exit 1 +$JARSIGNER -keystore $KS -storepass changeit $JFILE b -digestalg SHA-1 || exit 2 + +$JARSIGNER -keystore $KS -verify -debug -strict $JFILE || exit 3 + +exit 0 + diff --git a/test/sun/security/x509/AlgorithmId/SHA256withECDSA.java b/test/sun/security/x509/AlgorithmId/SHA256withECDSA.java new file mode 100644 index 0000000000000000000000000000000000000000..a1b81118a57009c4818bddc38bfb73a095950123 --- /dev/null +++ b/test/sun/security/x509/AlgorithmId/SHA256withECDSA.java @@ -0,0 +1,39 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * @test + * @bug 6871847 + * @summary AlgorithmId.get("SHA256withECDSA") not available + */ + +import sun.security.x509.*; + +public class SHA256withECDSA { + public static void main(String[] args) throws Exception { + AlgorithmId.get("SHA224withECDSA"); + AlgorithmId.get("SHA256withECDSA"); + AlgorithmId.get("SHA384withECDSA"); + AlgorithmId.get("SHA512withECDSA"); + } +}