Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/test/sun/security/tools/jarsigner/emptymanifest.sh
38854 views
#1# Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.2# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3#4# This code is free software; you can redistribute it and/or modify it5# under the terms of the GNU General Public License version 2 only, as6# published by the Free Software Foundation.7#8# This code is distributed in the hope that it will be useful, but WITHOUT9# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11# version 2 for more details (a copy is included in the LICENSE file that12# accompanied this code).13#14# You should have received a copy of the GNU General Public License version15# 2 along with this work; if not, write to the Free Software Foundation,16# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17#18# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19# or visit www.oracle.com if you need additional information or have any20# questions.21#2223# @test24# @bug 671275525# @summary jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_1326#27# @run shell emptymanifest.sh28#2930if [ "${TESTJAVA}" = "" ] ; then31JAVAC_CMD=`which javac`32TESTJAVA=`dirname $JAVAC_CMD`/..33fi3435# set platform-dependent variables36OS=`uname -s`37case "$OS" in38Windows_* )39FS="\\"40;;41* )42FS="/"43;;44esac4546KS=emptymanifest.jks47JFILE=em.jar4849KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit -keystore $KS"50JAR=$TESTJAVA${FS}bin${FS}jar51JAVA=$TESTJAVA${FS}bin${FS}java52JAVAC=$TESTJAVA${FS}bin${FS}javac53JARSIGNER=$TESTJAVA${FS}bin${FS}jarsigner5455rm $KS $JFILE56echo A > A57echo B > B58mkdir META-INF59cat <<EOF > CrLf.java60class CrLf {61public static void main(String[] args) throws Exception {62System.out.write(new byte[] {'\r', '\n'});63}64}65EOF66$JAVAC CrLf.java67$JAVA ${TESTVMOPTS} CrLf > META-INF${FS}MANIFEST.MF68zip $JFILE META-INF${FS}MANIFEST.MF A B6970$KT -alias a -dname CN=a -keyalg rsa -genkey -validity 3007172$JARSIGNER -keystore $KS -storepass changeit $JFILE a || exit 173$JARSIGNER -keystore $KS -verify -debug -strict $JFILE || exit 27475exit 0767778