1301N/A#
2755N/A# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
1301N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1301N/A#
1301N/A# This code is free software; you can redistribute it and/or modify it
1301N/A# under the terms of the GNU General Public License version 2 only, as
1301N/A# published by the Free Software Foundation.
1301N/A#
1301N/A# This code is distributed in the hope that it will be useful, but WITHOUT
1301N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1301N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1301N/A# version 2 for more details (a copy is included in the LICENSE file that
1301N/A# accompanied this code).
1301N/A#
1301N/A# You should have received a copy of the GNU General Public License version
1301N/A# 2 along with this work; if not, write to the Free Software Foundation,
1301N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1301N/A#
2362N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A# or visit www.oracle.com if you need additional information or have any
2362N/A# questions.
1301N/A#
1301N/A
1301N/A# @test
1301N/A# @bug 6712755
1301N/A# @summary jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
1301N/A#
1301N/A# @run shell emptymanifest.sh
1301N/A#
1301N/A
1301N/Aif [ "${TESTJAVA}" = "" ] ; then
1301N/A JAVAC_CMD=`which javac`
1301N/A TESTJAVA=`dirname $JAVAC_CMD`/..
1301N/Afi
1301N/A
1301N/A# set platform-dependent variables
1301N/AOS=`uname -s`
1301N/Acase "$OS" in
1301N/A Windows_* )
1301N/A FS="\\"
1301N/A ;;
1301N/A * )
1301N/A FS="/"
1301N/A ;;
1301N/Aesac
1301N/A
1301N/AKS=emptymanifest.jks
1301N/AJFILE=em.jar
1301N/A
1301N/AKT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit -keystore $KS"
1301N/AJAR=$TESTJAVA${FS}bin${FS}jar
2755N/AJAVA=$TESTJAVA${FS}bin${FS}java
2755N/AJAVAC=$TESTJAVA${FS}bin${FS}javac
1301N/AJARSIGNER=$TESTJAVA${FS}bin${FS}jarsigner
1301N/A
1301N/Arm $KS $JFILE
1301N/Aecho A > A
1301N/Aecho B > B
1301N/Amkdir META-INF
2755N/Acat <<EOF > CrLf.java
2755N/Aclass CrLf {
2755N/A public static void main(String[] args) throws Exception {
2755N/A System.out.write(new byte[] {'\r', '\n'});
2755N/A }
2755N/A}
2755N/AEOF
2755N/A$JAVAC CrLf.java
2755N/A$JAVA CrLf > META-INF${FS}MANIFEST.MF
1301N/Azip $JFILE META-INF${FS}MANIFEST.MF A B
1301N/A
1301N/A$KT -alias a -dname CN=a -keyalg rsa -genkey -validity 300
1301N/A
1301N/A$JARSIGNER -keystore $KS -storepass changeit $JFILE a || exit 1
1301N/A$JARSIGNER -keystore $KS -verify -debug -strict $JFILE || exit 2
1301N/A
1301N/Aexit 0