Mercurial > hg > release > icedtea-web-1.8
changeset 1258:01082f3b6119
Added tests for signed applet/app using Permission attribute
line wrap: on
line diff
--- a/ChangeLog Thu Jun 25 12:10:16 2015 +0200 +++ b/ChangeLog Fri Jul 10 19:11:44 2015 +0200 @@ -1,3 +1,52 @@ +2015-07-10 Jiri Vanek <jvanek@redhat.com> + + Added tests for signed applet/app using Permission attribute + * tests/reproducers/signed/SandboxSignedAllPerm/resources/SandboxSignedAllPerm.html + * tests/reproducers/signed/SandboxSignedAllPerm/resources/SandboxSignedAllPerm.jnlp + * tests/reproducers/signed/SandboxSignedAllPerm/resources/SandboxSignedAllPerm_applet.jnlp + * tests/reproducers/signed/SandboxSignedAllPerm/resources/SandboxSignedAllPerm_applet_security.jnlp + * tests/reproducers/signed/SandboxSignedAllPerm/resources/SandboxSignedAllPerm_security.jnlp + * tests/reproducers/signed/SandboxSignedAllPerm/srcs/META-INF/MANIFEST.MF + contains Permissions: all-permissions + * tests/reproducers/signed/SandboxSignedAllPerm/srcs/SandboxSignedAllPerm.java + * tests/reproducers/signed/SandboxSignedAllPerm/testcases/SandboxSignedAllPermTest.java + testcases with permissions in manifest check on + * tests/reproducers/signed/SandboxSignedInvalid/resources/SandboxSignedInvalid.html + * tests/reproducers/signed/SandboxSignedInvalid/resources/SandboxSignedInvalid.jnlp + * tests/reproducers/signed/SandboxSignedInvalid/resources/SandboxSignedInvalid_applet.jnlp + * tests/reproducers/signed/SandboxSignedInvalid/resources/SandboxSignedInvalid_applet_security.jnlp + * tests/reproducers/signed/SandboxSignedInvalid/resources/SandboxSignedInvalid_security.jnlp + * tests/reproducers/signed/SandboxSignedInvalid/srcs/META-INF/MANIFEST.MF + contains Permissions: invalidValue + * tests/reproducers/signed/SandboxSignedInvalid/srcs/SandboxSignedInvalid.java + * tests/reproducers/signed/SandboxSignedInvalid/testcases/SandboxSignedInvalidTest.java + testcases with permissions in manifest check on + * tests/reproducers/signed/SandboxSignedMissing/resources/SandboxSignedMissing.html + * tests/reproducers/signed/SandboxSignedMissing/resources/SandboxSignedMissing.jnlp + * tests/reproducers/signed/SandboxSignedMissing/resources/SandboxSignedMissing_applet.jnlp + * tests/reproducers/signed/SandboxSignedMissing/resources/SandboxSignedMissing_applet_security.jnlp + * tests/reproducers/signed/SandboxSignedMissing/resources/SandboxSignedMissing_security.jnlp + * tests/reproducers/signed/SandboxSignedMissing/srcs/META-INF/MANIFEST.MF + does not contains Permissions + * tests/reproducers/signed/SandboxSignedMissing/srcs/SandboxSignedMissing.java + * tests/reproducers/signed/SandboxSignedMissing/testcases/SandboxSignedMissingTest.java + testcases with permissions in manifest check on + * tests/reproducers/signed/SandboxSignedMissing/testcases/SandboxSignedMissingTestHighSecurity.java + testcases with permissions in manifest check on and on high security => interactive tests + with autoreply + * tests/reproducers/signed/SandboxSignedSandbox/resources/SandboxSignedSandbox.html + * tests/reproducers/signed/SandboxSignedSandbox/resources/SandboxSignedSandbox.jnlp + * tests/reproducers/signed/SandboxSignedSandbox/resources/SandboxSignedSandbox_applet.jnlp + * tests/reproducers/signed/SandboxSignedSandbox/resources/SandboxSignedSandbox_applet_security.jnlp + * tests/reproducers/signed/SandboxSignedSandbox/resources/SandboxSignedSandbox_security.jnlp + * tests/reproducers/signed/SandboxSignedSandbox/srcs/META-INF/MANIFEST.MF + contains Permissions: sandbox + * tests/reproducers/signed/SandboxSignedSandbox/srcs/SandboxSignedSandbox.java + * tests/reproducers/signed/SandboxSignedSandbox/testcases/SandboxSignedSandboxTest.java + testcases with permissions in manifest check on. Contains two failing tests + currently itw with snadbox in manifest and jnlp not requesting permissions fails. + Bug to be fixed + 2015-06-25 Jiri Vanek <jvanek@redhat.com> Fixed to short buttons for localized text - RH1231441
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/reproducers/signed/SandboxSignedAllPerm/resources/SandboxSignedAllPerm.html Fri Jul 10 19:11:44 2015 +0200 @@ -0,0 +1,42 @@ +<!-- + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + + --> +<html><head></head><body bgcolor="red"> +<p><applet code="SandboxSignedAllPerm.class" archive="SandboxSignedAllPerm.jar" codebase="." width="250" height="200"> +</applet></p> +</body> +</html> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/reproducers/signed/SandboxSignedAllPerm/resources/SandboxSignedAllPerm.jnlp Fri Jul 10 19:11:44 2015 +0200 @@ -0,0 +1,53 @@ +<!-- + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + + --> +<?xml version="1.0" encoding="utf-8"?> +<jnlp spec="1.0" href="SandboxSignedAllPerm.jnlp" codebase="."> + <information> + <title>SandboxSignedAllPerm</title> + <vendor>IcedTea</vendor> + <homepage href="http://icedtea.classpath.org/wiki/IcedTea-Web#Testing_IcedTea-Web"/> + <description>SandboxSignedAllPerm</description> + <offline/> + </information> + <resources> + <j2se version="1.4+"/> + <jar href="SandboxSignedAllPerm.jar"/> + </resources> + <application-desc main-class="SandboxSignedAllPerm"> + </application-desc> +</jnlp> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/reproducers/signed/SandboxSignedAllPerm/resources/SandboxSignedAllPerm_applet.jnlp Fri Jul 10 19:11:44 2015 +0200 @@ -0,0 +1,58 @@ +<!-- + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + + --> +<?xml version="1.0" encoding="utf-8"?> +<jnlp spec="1.0" href="SandboxSignedAllPerm_applet.jnlp" codebase="."> + <information> + <title>SandboxSignedAllPerm</title> + <vendor>IcedTea</vendor> + <homepage href="http://icedtea.classpath.org/wiki/IcedTea-Web#Testing_IcedTea-Web"/> + <description>SandboxSignedAllPerm</description> + <offline/> + </information> + <resources> + <j2se version="1.4+"/> + <jar href="SandboxSignedAllPerm.jar"/> + </resources> + <applet-desc + documentBase="." + name="SandboxSignedAllPerm" + main-class="SandboxSignedAllPerm" + width="250" + height="200"> + </applet-desc> +</jnlp> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/reproducers/signed/SandboxSignedAllPerm/resources/SandboxSignedAllPerm_applet_security.jnlp Fri Jul 10 19:11:44 2015 +0200 @@ -0,0 +1,61 @@ +<!-- + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + +--> +<?xml version="1.0" encoding="utf-8"?> +<jnlp spec="1.0" href="SandboxSignedAllPerm_applet_security.jnlp" codebase="."> + <information> + <title>SandboxSignedAllPerm</title> + <vendor>IcedTea</vendor> + <homepage href="http://icedtea.classpath.org/wiki/IcedTea-Web#Testing_IcedTea-Web"/> + <description>SandboxSignedAllPerm</description> + <offline/> + </information> + <resources> + <j2se version="1.4+"/> + <jar href="SandboxSignedAllPerm.jar"/> + </resources> + <security> + <all-permissions/> + </security> + <applet-desc + documentBase="." + name="SandboxSignedAllPerm" + main-class="SandboxSignedAllPerm" + width="250" + height="200"> + </applet-desc> +</jnlp> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/reproducers/signed/SandboxSignedAllPerm/resources/SandboxSignedAllPerm_security.jnlp Fri Jul 10 19:11:44 2015 +0200 @@ -0,0 +1,56 @@ +<!-- + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + + --> +<?xml version="1.0" encoding="utf-8"?> +<jnlp spec="1.0" href="SandboxSignedAllPerm_security.jnlp" codebase="."> + <information> + <title>SandboxSignedAllPerm</title> + <vendor>IcedTea</vendor> + <homepage href="http://icedtea.classpath.org/wiki/IcedTea-Web#Testing_IcedTea-Web"/> + <description>SandboxSignedAllPerm</description> + <offline/> + </information> + <resources> + <j2se version="1.4+"/> + <jar href="SandboxSignedAllPerm.jar"/> + </resources> + <security> + <all-permissions/> + </security> + <application-desc main-class="SandboxSignedAllPerm"> + </application-desc> +</jnlp> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/reproducers/signed/SandboxSignedAllPerm/srcs/META-INF/MANIFEST.MF Fri Jul 10 19:11:44 2015 +0200 @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Permissions: all-permissions +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/reproducers/signed/SandboxSignedAllPerm/srcs/SandboxSignedAllPerm.java Fri Jul 10 19:11:44 2015 +0200 @@ -0,0 +1,57 @@ + +import java.applet.Applet; + +/* AppletTest.java + Copyright (C) 2011 Red Hat, Inc. + + This file is part of IcedTea. + + IcedTea is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 2. + + IcedTea 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 for more details. + + You should have received a copy of the GNU General Public License + along with IcedTea; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. + */ +public class SandboxSignedAllPerm extends Applet { + + @Override + public void init() { + confirm(); + } + + public static void main(String... s) { + confirm(); + } + + private static void confirm() { + System.out.println("*** applet running ***"); + System.out.println(System.getProperty("user.home")); + System.out.println("*** APPLET FINISHED ***"); + } + +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/reproducers/signed/SandboxSignedAllPerm/testcases/SandboxSignedAllPermTest.java Fri Jul 10 19:11:44 2015 +0200 @@ -0,0 +1,123 @@ + +import java.io.IOException; +import java.util.Arrays; +import net.sourceforge.jnlp.ProcessResult; +import net.sourceforge.jnlp.ServerAccess; +import net.sourceforge.jnlp.annotations.TestInBrowsers; +import net.sourceforge.jnlp.browsertesting.BrowserTest; +import net.sourceforge.jnlp.browsertesting.Browsers; +import net.sourceforge.jnlp.closinglisteners.AutoErrorClosingListener; +import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; +import net.sourceforge.jnlp.closinglisteners.StringBasedClosingListener; +import net.sourceforge.jnlp.config.DeploymentConfiguration; +import net.sourceforge.jnlp.runtime.ManifestAttributesChecker; +import net.sourceforge.jnlp.tools.DeploymentPropertiesModifier; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +/* AppletTest.java + Copyright (C) 2011 Red Hat, Inc. + + This file is part of IcedTea. + + IcedTea is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 2. + + IcedTea 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 for more details. + + You should have received a copy of the GNU General Public License + along with IcedTea; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. + */ +public class SandboxSignedAllPermTest extends BrowserTest { + + private static final DeploymentPropertiesModifier dpm = new DeploymentPropertiesModifier(); + private static final StringBasedClosingListener aok = new AutoOkClosingListener(); + private static final StringBasedClosingListener aer = new AutoErrorClosingListener(); + private static final String confirmation = "*** applet running ***"; + @BeforeClass + public static void setDeploymentManifestPermissionReadingOnly() throws IOException{ + dpm.setProperties(DeploymentConfiguration.KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK, ManifestAttributesChecker.MANIFEST_ATTRIBUTES_CHECK.PERMISSIONS.toString()); + } + + @AfterClass + public static void restoreDeploymentProeprtiees() throws IOException{ + dpm.restoreProperties(); + } + + @Test + //no security dialog + //crash (jnlp dont have all-permnissions) + public void javawsAllPermNoSecurity() throws Exception{ + ProcessResult p = server.executeJavawsHeadless("SandboxSignedAllPerm.jnlp"); + Assert.assertTrue(p.stdout.contains(confirmation)); + Assert.assertFalse(p.stdout.contains(aok.getCondition())); + Assert.assertTrue(p.stderr.contains(aer.getCondition())); + } + @Test + //no security dialog + //pass + public void javawsAllPermAllSecurity() throws Exception{ + ProcessResult p = server.executeJavawsHeadless("SandboxSignedAllPerm_security.jnlp"); + Assert.assertTrue(p.stdout.contains(confirmation)); + Assert.assertTrue(p.stdout.contains(aok.getCondition())); + Assert.assertFalse(p.stderr.contains(aer.getCondition())); + } + + @Test + //no security dialog + //crash (jnlp dont have all-permnissions) + public void javawsAppletAllPermNoSecurity() throws Exception{ + ProcessResult p = server.executeJavaws(Arrays.asList(new String[]{"-headless", "-verbose"}), "SandboxSignedAllPerm_applet.jnlp", new AutoOkClosingListener(), new AutoErrorClosingListener()); + Assert.assertTrue(p.stdout.contains(confirmation)); + Assert.assertFalse(p.stdout.contains(aok.getCondition())); + Assert.assertTrue(p.stderr.contains(aer.getCondition())); //applets have exception flused only in verbose mode? strange... + } + @Test + //no security dialog + //pass + public void javawsAppletAllPermAllSecurity() throws Exception{ + ProcessResult p = server.executeJavawsHeadless("SandboxSignedAllPerm_applet_security.jnlp", new AutoOkClosingListener(), new AutoErrorClosingListener()); + Assert.assertTrue(p.stdout.contains(confirmation)); + Assert.assertTrue(p.stdout.contains(aok.getCondition())); + Assert.assertFalse(p.stderr.contains(aer.getCondition())); + } + + @Test + @TestInBrowsers(testIn = Browsers.one) + //no security dialog + //pass + public void appletAllPermAllSecurity() throws Exception{ + server.getBrowserLocation(); + ProcessResult p = server.executeBrowser("SandboxSignedAllPerm.html", ServerAccess.AutoClose.CLOSE_ON_BOTH); + Assert.assertTrue(p.stdout.contains(confirmation)); + Assert.assertTrue(p.stdout.contains(aok.getCondition())); + Assert.assertFalse(p.stderr.contains(aer.getCondition())); + } + + +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/reproducers/signed/SandboxSignedInvalid/resources/SandboxSignedInvalid.html Fri Jul 10 19:11:44 2015 +0200 @@ -0,0 +1,42 @@ +<!-- + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + + --> +<html><head></head><body bgcolor="red"> +<p><applet code="SandboxSignedInvalid.class" archive="SandboxSignedInvalid.jar" codebase="." width="250" height="200"> +</applet></p> +</body> +</html> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/reproducers/signed/SandboxSignedInvalid/resources/SandboxSignedInvalid.jnlp Fri Jul 10 19:11:44 2015 +0200 @@ -0,0 +1,53 @@ +<!-- + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + + --> +<?xml version="1.0" encoding="utf-8"?> +<jnlp spec="1.0" href="SandboxSignedInvalid.jnlp" codebase="."> + <information> + <title>SandboxSignedInvalid</title> + <vendor>IcedTea</vendor> + <homepage href="http://icedtea.classpath.org/wiki/IcedTea-Web#Testing_IcedTea-Web"/> + <description>SandboxSignedInvalid</description> + <offline/> + </information> + <resources> + <j2se version="1.4+"/> + <jar href="SandboxSignedInvalid.jar"/> + </resources> + <application-desc main-class="SandboxSignedInvalid"> + </application-desc> +</jnlp> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/reproducers/signed/SandboxSignedInvalid/resources/SandboxSignedInvalid_applet.jnlp Fri Jul 10 19:11:44 2015 +0200 @@ -0,0 +1,58 @@ +<!-- + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + + --> +<?xml version="1.0" encoding="utf-8"?> +<jnlp spec="1.0" href="SandboxSignedInvalid_applet.jnlp" codebase="."> + <information> + <title>SandboxSignedInvalid</title> + <vendor>IcedTea</vendor> + <homepage href="http://icedtea.classpath.org/wiki/IcedTea-Web#Testing_IcedTea-Web"/> + <description>SandboxSignedInvalid</description> + <offline/> + </information> + <resources> + <j2se version="1.4+"/> + <jar href="SandboxSignedInvalid.jar"/> + </resources> + <applet-desc + documentBase="." + name="SandboxSignedInvalid" + main-class="SandboxSignedInvalid" + width="250" + height="200"> + </applet-desc> +</jnlp> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/reproducers/signed/SandboxSignedInvalid/resources/SandboxSignedInvalid_applet_security.jnlp Fri Jul 10 19:11:44 2015 +0200 @@ -0,0 +1,61 @@ +<!-- + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + + --> +<?xml version="1.0" encoding="utf-8"?> +<jnlp spec="1.0" href="SandboxSignedInvalid_applet_security.jnlp" codebase="."> + <information> + <title>SandboxSignedMissing</title> + <vendor>IcedTea</vendor> + <homepage href="http://icedtea.classpath.org/wiki/IcedTea-Web#Testing_IcedTea-Web"/> + <description>SandboxSignedInvalid</description> + <offline/> + </information> + <resources> + <j2se version="1.4+"/> + <jar href="SandboxSignedInvalid.jar"/> + </resources> + <security> + <all-permissions/> + </security> + <applet-desc + documentBase="." + name="SandboxSignedInvalid" + main-class="SandboxSignedInvalid" + width="250" + height="200"> + </applet-desc> +</jnlp> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/reproducers/signed/SandboxSignedInvalid/resources/SandboxSignedInvalid_security.jnlp Fri Jul 10 19:11:44 2015 +0200 @@ -0,0 +1,56 @@ +<!-- + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + + --> +<?xml version="1.0" encoding="utf-8"?> +<jnlp spec="1.0" href="SandboxSignedInvalid_security.jnlp" codebase="."> + <information> + <title>SandboxSignedMissing</title> + <vendor>IcedTea</vendor> + <homepage href="http://icedtea.classpath.org/wiki/IcedTea-Web#Testing_IcedTea-Web"/> + <description>SandboxSignedInvalid</description> + <offline/> + </information> + <resources> + <j2se version="1.4+"/> + <jar href="SandboxSignedInvalid.jar"/> + </resources> + <security> + <all-permissions/> + </security> + <application-desc main-class="SandboxSignedInvalid"> + </application-desc> +</jnlp> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/reproducers/signed/SandboxSignedInvalid/srcs/META-INF/MANIFEST.MF Fri Jul 10 19:11:44 2015 +0200 @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Permissions: invalidValue +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/reproducers/signed/SandboxSignedInvalid/srcs/SandboxSignedInvalid.java Fri Jul 10 19:11:44 2015 +0200 @@ -0,0 +1,57 @@ + +import java.applet.Applet; + +/* AppletTest.java + Copyright (C) 2011 Red Hat, Inc. + + This file is part of IcedTea. + + IcedTea is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 2. + + IcedTea 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 for more details. + + You should have received a copy of the GNU General Public License + along with IcedTea; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. + */ +public class SandboxSignedInvalid extends Applet { + + + @Override + public void init() { + confirm(); + } + + public static void main(String... s) { + confirm(); + } + + private static void confirm() { + System.out.println("*** applet running ***"); + System.out.println(System.getProperty("user.home")); + System.out.println("*** APPLET FINISHED ***"); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/reproducers/signed/SandboxSignedInvalid/testcases/SandboxSignedInvalidTest.java Fri Jul 10 19:11:44 2015 +0200 @@ -0,0 +1,125 @@ + +import java.io.IOException; +import net.sourceforge.jnlp.ProcessResult; +import net.sourceforge.jnlp.ServerAccess; +import net.sourceforge.jnlp.annotations.TestInBrowsers; +import net.sourceforge.jnlp.browsertesting.BrowserTest; +import static net.sourceforge.jnlp.browsertesting.BrowserTest.server; +import net.sourceforge.jnlp.browsertesting.Browsers; +import net.sourceforge.jnlp.closinglisteners.AutoErrorClosingListener; +import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; +import net.sourceforge.jnlp.closinglisteners.StringBasedClosingListener; +import net.sourceforge.jnlp.config.DeploymentConfiguration; +import net.sourceforge.jnlp.runtime.ManifestAttributesChecker; +import net.sourceforge.jnlp.tools.DeploymentPropertiesModifier; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +/* AppletTest.java + Copyright (C) 2011 Red Hat, Inc. + + This file is part of IcedTea. + + IcedTea is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 2. + + IcedTea 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 for more details. + + You should have received a copy of the GNU General Public License + along with IcedTea; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. + */ +public class SandboxSignedInvalidTest extends BrowserTest { + + private static final DeploymentPropertiesModifier dpm = new DeploymentPropertiesModifier(); + private static final StringBasedClosingListener aok = new AutoOkClosingListener(); + private static final StringBasedClosingListener aer = new AutoErrorClosingListener(); + private static final String confirmation = "*** applet running ***"; + + + @BeforeClass + public static void setDeploymentManifestPermissionReadingOnly() throws IOException{ + dpm.setProperties(DeploymentConfiguration.KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK, ManifestAttributesChecker.MANIFEST_ATTRIBUTES_CHECK.PERMISSIONS.toString()); + } + + @AfterClass + public static void restoreDeploymentProeprtiees() throws IOException{ + dpm.restoreProperties(); + } + + @Test + //no security dialog + //crash (jnlp dont have all-permnissions) + public void javawsAllPermNoSecurity() throws Exception{ + ProcessResult p = server.executeJavawsHeadless("SandboxSignedInvalid.jnlp"); + Assert.assertFalse(p.stdout.contains(confirmation)); + Assert.assertFalse(p.stdout.contains(aok.getCondition())); + Assert.assertTrue(p.stderr.contains(aer.getCondition())); + } + @Test + //no security dialog + //pass + public void javawsAllPermAllSecurity() throws Exception{ + ProcessResult p = server.executeJavawsHeadless("SandboxSignedInvalid_security.jnlp"); + Assert.assertFalse(p.stdout.contains(confirmation)); + Assert.assertFalse(p.stdout.contains(aok.getCondition())); + Assert.assertTrue(p.stderr.contains(aer.getCondition())); + } + + @Test + //no security dialog + //crash (jnlp dont have all-permnissions) + public void javawsAppletAllPermNoSecurity() throws Exception{ + ProcessResult p = server.executeJavawsHeadless("SandboxSignedInvalid_applet.jnlp", new AutoOkClosingListener(), new AutoErrorClosingListener()); + Assert.assertFalse(p.stdout.contains(confirmation)); + Assert.assertFalse(p.stdout.contains(aok.getCondition())); + Assert.assertTrue(p.stderr.contains(aer.getCondition())); + } + @Test + //no security dialog + //pass + public void javawsAppletAllPermAllSecurity() throws Exception{ + ProcessResult p = server.executeJavawsHeadless("SandboxSignedInvalid_applet_security.jnlp", new AutoOkClosingListener(), new AutoErrorClosingListener()); + Assert.assertFalse(p.stdout.contains(confirmation)); + Assert.assertFalse(p.stdout.contains(aok.getCondition())); + Assert.assertTrue(p.stderr.contains(aer.getCondition())); + } + + @Test + @TestInBrowsers(testIn = Browsers.one) + //no security dialog + //pass + public void appletAllPermAllSecurity() throws Exception{ + server.getBrowserLocation(); + ProcessResult p = server.executeBrowser("SandboxSignedInvalid.html", ServerAccess.AutoClose.CLOSE_ON_BOTH); + Assert.assertFalse(p.stdout.contains(confirmation)); + Assert.assertFalse(p.stdout.contains(aok.getCondition())); + Assert.assertTrue(p.stderr.contains(aer.getCondition())); + } + + +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/reproducers/signed/SandboxSignedMissing/resources/SandboxSignedMissing.html Fri Jul 10 19:11:44 2015 +0200 @@ -0,0 +1,42 @@ +<!-- + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + + --> +<html><head></head><body bgcolor="red"> +<p><applet code="SandboxSignedMissing.class" archive="SandboxSignedMissing.jar" codebase="." width="250" height="200"> +</applet></p> +</body> +</html> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/reproducers/signed/SandboxSignedMissing/resources/SandboxSignedMissing.jnlp Fri Jul 10 19:11:44 2015 +0200 @@ -0,0 +1,53 @@ +<!-- + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + + --> +<?xml version="1.0" encoding="utf-8"?> +<jnlp spec="1.0" href="SandboxSignedMissing.jnlp" codebase="."> + <information> + <title>SandboxSignedMissing</title> + <vendor>IcedTea</vendor> + <homepage href="http://icedtea.classpath.org/wiki/IcedTea-Web#Testing_IcedTea-Web"/> + <description>SandboxSignedMissing</description> + <offline/> + </information> + <resources> + <j2se version="1.4+"/> + <jar href="SandboxSignedMissing.jar"/> + </resources> + <application-desc main-class="SandboxSignedMissing"> + </application-desc> +</jnlp> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/reproducers/signed/SandboxSignedMissing/resources/SandboxSignedMissing_applet.jnlp Fri Jul 10 19:11:44 2015 +0200 @@ -0,0 +1,58 @@ +<!-- + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + + --> +<?xml version="1.0" encoding="utf-8"?> +<jnlp spec="1.0" href="SandboxSignedMissing_applet.jnlp" codebase="."> + <information> + <title>SandboxSignedMissing</title> + <vendor>IcedTea</vendor> + <homepage href="http://icedtea.classpath.org/wiki/IcedTea-Web#Testing_IcedTea-Web"/> + <description>SandboxSignedMissing</description> + <offline/> + </information> + <resources> + <j2se version="1.4+"/> + <jar href="SandboxSignedMissing.jar"/> + </resources> + <applet-desc + documentBase="." + name="SandboxSignedMissing" + main-class="SandboxSignedMissing" + width="250" + height="200"> + </applet-desc> +</jnlp> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/reproducers/signed/SandboxSignedMissing/resources/SandboxSignedMissing_applet_security.jnlp Fri Jul 10 19:11:44 2015 +0200 @@ -0,0 +1,61 @@ +<!-- + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + + --> +<?xml version="1.0" encoding="utf-8"?> +<jnlp spec="1.0" href="SandboxSignedMissing_applet_security.jnlp" codebase="."> + <information> + <title>SandboxSignedMissing</title> + <vendor>IcedTea</vendor> + <homepage href="http://icedtea.classpath.org/wiki/IcedTea-Web#Testing_IcedTea-Web"/> + <description>SandboxSignedMissing</description> + <offline/> + </information> + <resources> + <j2se version="1.4+"/> + <jar href="SandboxSignedMissing.jar"/> + </resources> + <security> + <all-permissions/> + </security> + <applet-desc + documentBase="." + name="SandboxSignedMissing" + main-class="SandboxSignedMissing" + width="250" + height="200"> + </applet-desc> +</jnlp> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/reproducers/signed/SandboxSignedMissing/resources/SandboxSignedMissing_security.jnlp Fri Jul 10 19:11:44 2015 +0200 @@ -0,0 +1,56 @@ +<!-- + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + + --> +<?xml version="1.0" encoding="utf-8"?> +<jnlp spec="1.0" href="SandboxSignedMissing_security.jnlp" codebase="."> + <information> + <title>SandboxSignedMissing</title> + <vendor>IcedTea</vendor> + <homepage href="http://icedtea.classpath.org/wiki/IcedTea-Web#Testing_IcedTea-Web"/> + <description>SandboxSignedMissing</description> + <offline/> + </information> + <resources> + <j2se version="1.4+"/> + <jar href="SandboxSignedMissing.jar"/> + </resources> + <security> + <all-permissions/> + </security> + <application-desc main-class="SandboxSignedMissing"> + </application-desc> +</jnlp> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/reproducers/signed/SandboxSignedMissing/srcs/META-INF/MANIFEST.MF Fri Jul 10 19:11:44 2015 +0200 @@ -0,0 +1,2 @@ +Manifest-Version: 1.0 +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/reproducers/signed/SandboxSignedMissing/srcs/SandboxSignedMissing.java Fri Jul 10 19:11:44 2015 +0200 @@ -0,0 +1,57 @@ + +import java.applet.Applet; + +/* AppletTest.java + Copyright (C) 2011 Red Hat, Inc. + + This file is part of IcedTea. + + IcedTea is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 2. + + IcedTea 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 for more details. + + You should have received a copy of the GNU General Public License + along with IcedTea; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. + */ +public class SandboxSignedMissing extends Applet { + + @Override + public void init() { + confirm(); + } + + public static void main(String... s) { + confirm(); + } + + private static void confirm() { + System.out.println("*** applet running ***"); + System.out.println(System.getProperty("user.home")); + System.out.println("*** APPLET FINISHED ***"); + } + +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/reproducers/signed/SandboxSignedMissing/testcases/SandboxSignedMissingTest.java Fri Jul 10 19:11:44 2015 +0200 @@ -0,0 +1,130 @@ + +import java.io.IOException; +import java.util.Arrays; +import net.sourceforge.jnlp.ProcessResult; +import net.sourceforge.jnlp.ServerAccess; +import net.sourceforge.jnlp.annotations.TestInBrowsers; +import net.sourceforge.jnlp.browsertesting.BrowserTest; +import static net.sourceforge.jnlp.browsertesting.BrowserTest.server; +import net.sourceforge.jnlp.browsertesting.Browsers; +import net.sourceforge.jnlp.closinglisteners.AutoErrorClosingListener; +import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; +import net.sourceforge.jnlp.closinglisteners.StringBasedClosingListener; +import net.sourceforge.jnlp.config.DeploymentConfiguration; +import net.sourceforge.jnlp.runtime.ManifestAttributesChecker; +import net.sourceforge.jnlp.security.appletextendedsecurity.AppletSecurityLevel; +import net.sourceforge.jnlp.tools.DeploymentPropertiesModifier; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +/* AppletTest.java + Copyright (C) 2011 Red Hat, Inc. + + This file is part of IcedTea. + + IcedTea is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 2. + + IcedTea 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 for more details. + + You should have received a copy of the GNU General Public License + along with IcedTea; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. + */ +public class SandboxSignedMissingTest extends BrowserTest { + + private static final DeploymentPropertiesModifier dpm1 = new DeploymentPropertiesModifier(); + private static final DeploymentPropertiesModifier dpm2 = new DeploymentPropertiesModifier(); + private static final StringBasedClosingListener aok = new AutoOkClosingListener(); + private static final StringBasedClosingListener aer = new AutoErrorClosingListener(); + private static final String confirmation = "*** applet running ***"; + + + @BeforeClass + public static void setDeploymentManifestPermissionReadingOnly() throws IOException{ + dpm1.setProperties(DeploymentConfiguration.KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK, ManifestAttributesChecker.MANIFEST_ATTRIBUTES_CHECK.PERMISSIONS.toString()); + dpm2.setProperties(DeploymentConfiguration.KEY_SECURITY_LEVEL, AppletSecurityLevel.ALLOW_UNSIGNED.toChars()); + } + + @AfterClass + public static void restoreDeploymentProeprtiees() throws IOException{ + dpm2.restoreProperties(); + dpm1.restoreProperties(); + } + + @Test + //no security dialog + //crash (jnlp dont have all-permnissions) + public void javawsAllPermNoSecurity() throws Exception{ + ProcessResult p = server.executeJavawsHeadless("SandboxSignedMissing.jnlp"); + Assert.assertTrue(p.stdout.contains(confirmation)); + Assert.assertFalse(p.stdout.contains(aok.getCondition())); + Assert.assertTrue(p.stderr.contains(aer.getCondition())); + } + @Test + //no security dialog + //pass + public void javawsAllPermAllSecurity() throws Exception{ + ProcessResult p = server.executeJavawsHeadless("SandboxSignedMissing_security.jnlp"); + Assert.assertTrue(p.stdout.contains(confirmation)); + Assert.assertTrue(p.stdout.contains(aok.getCondition())); + Assert.assertFalse(p.stderr.contains(aer.getCondition())); + } + + @Test + //no security dialog + //crash (jnlp dont have all-permnissions) + public void javawsAppletAllPermNoSecurity() throws Exception{ + ProcessResult p = server.executeJavaws(Arrays.asList(new String[]{"-headless", "-verbose"}),"SandboxSignedMissing_applet.jnlp", new AutoOkClosingListener(), new AutoErrorClosingListener()); + Assert.assertTrue(p.stdout.contains(confirmation)); + Assert.assertFalse(p.stdout.contains(aok.getCondition())); + Assert.assertTrue(p.stderr.contains(aer.getCondition()));//applets have exception flused only in verbose mode? strange... + } + @Test + //no security dialog + //pass + public void javawsAppletAllPermAllSecurity() throws Exception{ + ProcessResult p = server.executeJavawsHeadless("SandboxSignedMissing_applet_security.jnlp", new AutoOkClosingListener(), new AutoErrorClosingListener()); + Assert.assertTrue(p.stdout.contains(confirmation)); + Assert.assertTrue(p.stdout.contains(aok.getCondition())); + Assert.assertFalse(p.stderr.contains(aer.getCondition())); + } + + @Test + @TestInBrowsers(testIn = Browsers.one) + //no security dialog + //pass + public void appletAllPermAllSecurity() throws Exception{ + server.getBrowserLocation(); + ProcessResult p = server.executeBrowser("SandboxSignedMissing.html", ServerAccess.AutoClose.CLOSE_ON_BOTH); + Assert.assertTrue(p.stdout.contains(confirmation)); + Assert.assertTrue(p.stdout.contains(aok.getCondition())); + Assert.assertFalse(p.stderr.contains(aer.getCondition())); + } + + +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/reproducers/signed/SandboxSignedMissing/testcases/SandboxSignedMissingTestHighSecurity.java Fri Jul 10 19:11:44 2015 +0200 @@ -0,0 +1,195 @@ + +import java.io.IOException; +import java.util.Arrays; +import net.sourceforge.jnlp.ProcessResult; +import net.sourceforge.jnlp.ProcessWrapper; +import net.sourceforge.jnlp.ServerAccess; +import net.sourceforge.jnlp.annotations.TestInBrowsers; +import net.sourceforge.jnlp.browsertesting.BrowserTest; +import static net.sourceforge.jnlp.browsertesting.BrowserTest.server; +import net.sourceforge.jnlp.browsertesting.Browsers; +import net.sourceforge.jnlp.closinglisteners.AutoErrorClosingListener; +import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; +import net.sourceforge.jnlp.closinglisteners.StringBasedClosingListener; +import net.sourceforge.jnlp.config.DeploymentConfiguration; +import net.sourceforge.jnlp.runtime.ManifestAttributesChecker; +import net.sourceforge.jnlp.security.appletextendedsecurity.AppletSecurityLevel; +import net.sourceforge.jnlp.tools.DeploymentPropertiesModifier; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +/* AppletTest.java + Copyright (C) 2011 Red Hat, Inc. + + This file is part of IcedTea. + + IcedTea is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 2. + + IcedTea 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 for more details. + + You should have received a copy of the GNU General Public License + along with IcedTea; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. + */ +public class SandboxSignedMissingTestHighSecurity extends BrowserTest { + + private static final DeploymentPropertiesModifier dpm1 = new DeploymentPropertiesModifier(); + private static final DeploymentPropertiesModifier dpm2 = new DeploymentPropertiesModifier(); + private static final StringBasedClosingListener aok = new AutoOkClosingListener(); + private static final StringBasedClosingListener aer = new AutoErrorClosingListener(); + private static final String confirmation = "*** applet running ***"; + + + @BeforeClass + public static void setDeploymentManifestPermissionReadingOnly() throws IOException{ + dpm1.setProperties(DeploymentConfiguration.KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK, ManifestAttributesChecker.MANIFEST_ATTRIBUTES_CHECK.PERMISSIONS.toString()); + dpm2.setProperties(DeploymentConfiguration.KEY_SECURITY_LEVEL, AppletSecurityLevel.ASK_UNSIGNED.toChars()); + } + + @AfterClass + public static void restoreDeploymentProeprtiees() throws IOException{ + dpm2.restoreProperties(); + dpm1.restoreProperties(); + } + + @Test + // security dialog + //crash (jnlp dont have all-permnissions) + public void javawsAllPermNoSecurityYes() throws Exception{ + ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), Arrays.asList("-headless"), server.getUrl("SandboxSignedMissing.jnlp")); + pw.setWriter("YES\n"); + ProcessResult p = pw.execute(); + Assert.assertTrue(p.stdout.contains(confirmation)); + Assert.assertFalse(p.stdout.contains(aok.getCondition())); + Assert.assertTrue(p.stderr.contains(aer.getCondition())); + } + + // security dialog + //crash (jnlp dont have all-permnissions) + @Test + public void javawsAllPermNoSecurityNo() throws Exception{ + ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), Arrays.asList("-headless"), server.getUrl("SandboxSignedMissing.jnlp")); + pw.setWriter("NO\n"); + ProcessResult p = pw.execute(); + Assert.assertFalse(p.stdout.contains(confirmation)); + Assert.assertFalse(p.stdout.contains(aok.getCondition())); + Assert.assertTrue(p.stderr.contains(aer.getCondition())); + } + + @Test + // security dialog + //pass + public void javawsAllPermAllSecurityYes() throws Exception{ + ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), Arrays.asList("-headless"), server.getUrl("SandboxSignedMissing_security.jnlp")); + pw.setWriter("YES\n"); + ProcessResult p = pw.execute(); + Assert.assertTrue(p.stdout.contains(confirmation)); + Assert.assertTrue(p.stdout.contains(aok.getCondition())); + Assert.assertFalse(p.stderr.contains(aer.getCondition())); + } + + @Test + // security dialog + //pass + public void javawsAllPermAllSecurityNo() throws Exception{ + ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), Arrays.asList("-headless"), server.getUrl("SandboxSignedMissing_security.jnlp")); + pw.setWriter("NO\n"); + ProcessResult p = pw.execute(); + Assert.assertFalse(p.stdout.contains(confirmation)); + Assert.assertFalse(p.stdout.contains(aok.getCondition())); + Assert.assertTrue(p.stderr.contains(aer.getCondition())); + } + + @Test + // security dialog + //crash (jnlp dont have all-permnissions) + public void javawsAppletAllPermNoSecurityYes() throws Exception{ + ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), Arrays.asList("-headless", "-verbose"), server.getUrl("SandboxSignedMissing_applet.jnlp")); + pw.addStdOutListener(new AutoOkClosingListener()); + pw.setWriter("YES\n"); + ProcessResult p = pw.execute(); + Assert.assertTrue(p.stdout.contains(confirmation)); + Assert.assertFalse(p.stdout.contains(aok.getCondition())); + Assert.assertTrue(p.stderr.contains(aer.getCondition()));//applets have exception flused only in verbose mode? strange... + } + + @Test + // security dialog + //crash (jnlp dont have all-permnissions) + public void javawsAppletAllPermNoSecurityNo() throws Exception{ + ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), Arrays.asList("-headless", "-verbose"), server.getUrl("SandboxSignedMissing_applet.jnlp")); + pw.addStdErrListener(new AutoErrorClosingListener()); + pw.addStdOutListener(new AutoOkClosingListener()); + pw.setWriter("NO\n"); + ProcessResult p = pw.execute(); + Assert.assertFalse(p.stdout.contains(confirmation)); + Assert.assertFalse(p.stdout.contains(aok.getCondition())); + Assert.assertTrue(p.stderr.contains(aer.getCondition()));//applets have exception flused only in verbose mode? strange... + } + + @Test + //security dialog + //pass + public void javawsAppletAllPermAllSecurityYes() throws Exception{ + ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), Arrays.asList("-headless"), server.getUrl("SandboxSignedMissing_applet_security.jnlp")); + pw.addStdOutListener(new AutoOkClosingListener()); + pw.setWriter("YES\n"); + ProcessResult p = pw.execute(); + Assert.assertTrue(p.stdout.contains(confirmation)); + Assert.assertTrue(p.stdout.contains(aok.getCondition())); + Assert.assertFalse(p.stderr.contains(aer.getCondition())); + } + @Test + //security dialog + //pass + public void javawsAppletAllPermAllSecurityNo() throws Exception{ + ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), Arrays.asList("-headless"), server.getUrl("SandboxSignedMissing_applet_security.jnlp")); + pw.addStdErrListener(new AutoErrorClosingListener()); + pw.addStdOutListener(new AutoOkClosingListener()); + pw.setWriter("NO\n"); + ProcessResult p = pw.execute(); + Assert.assertFalse(p.stdout.contains(confirmation)); + Assert.assertFalse(p.stdout.contains(aok.getCondition())); + Assert.assertTrue(p.stderr.contains(aer.getCondition())); + } + + //browser do not support headless dialogues + //@Test + //@TestInBrowsers(testIn = Browsers.one) + //no security dialog + //pass + public void appletAllPermAllSecurity() throws Exception{ + server.getBrowserLocation(); + ProcessResult p = server.executeBrowser("SandboxSignedMissing.html", ServerAccess.AutoClose.CLOSE_ON_BOTH); + Assert.assertTrue(p.stdout.contains(confirmation)); + Assert.assertTrue(p.stdout.contains(aok.getCondition())); + Assert.assertFalse(p.stderr.contains(aer.getCondition())); + } + + +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/reproducers/signed/SandboxSignedSandbox/resources/SandboxSignedSandbox.html Fri Jul 10 19:11:44 2015 +0200 @@ -0,0 +1,42 @@ +<!-- + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + + --> +<html><head></head><body bgcolor="red"> +<p><applet code="SandboxSignedSandbox.class" archive="SandboxSignedSandbox.jar" codebase="." width="250" height="200"> +</applet></p> +</body> +</html> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/reproducers/signed/SandboxSignedSandbox/resources/SandboxSignedSandbox.jnlp Fri Jul 10 19:11:44 2015 +0200 @@ -0,0 +1,53 @@ +<!-- + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + + --> +<?xml version="1.0" encoding="utf-8"?> +<jnlp spec="1.0" href="SandboxSignedSandbox.jnlp" codebase="."> + <information> + <title>SandboxSignedSandbox</title> + <vendor>IcedTea</vendor> + <homepage href="http://icedtea.classpath.org/wiki/IcedTea-Web#Testing_IcedTea-Web"/> + <description>SandboxSignedSandbox</description> + <offline/> + </information> + <resources> + <j2se version="1.4+"/> + <jar href="SandboxSignedSandbox.jar"/> + </resources> + <application-desc main-class="SandboxSignedSandbox"> + </application-desc> +</jnlp> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/reproducers/signed/SandboxSignedSandbox/resources/SandboxSignedSandbox_applet.jnlp Fri Jul 10 19:11:44 2015 +0200 @@ -0,0 +1,58 @@ +<!-- + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + +--> +<?xml version="1.0" encoding="utf-8"?> +<jnlp spec="1.0" href="SandboxSignedSandbox_applet.jnlp" codebase="."> + <information> + <title>SandboxSignedSandbox</title> + <vendor>IcedTea</vendor> + <homepage href="http://icedtea.classpath.org/wiki/IcedTea-Web#Testing_IcedTea-Web"/> + <description>SandboxSignedSandbox</description> + <offline/> + </information> + <resources> + <j2se version="1.4+"/> + <jar href="SandboxSignedSandbox.jar"/> + </resources> + <applet-desc + documentBase="." + name="SandboxSignedSandbox" + main-class="SandboxSignedSandbox" + width="250" + height="200"> + </applet-desc> +</jnlp> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/reproducers/signed/SandboxSignedSandbox/resources/SandboxSignedSandbox_applet_security.jnlp Fri Jul 10 19:11:44 2015 +0200 @@ -0,0 +1,61 @@ +<!-- + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + + --> +<?xml version="1.0" encoding="utf-8"?> +<jnlp spec="1.0" href="SandboxSignedSandbox_applet_security.jnlp" codebase="."> + <information> + <title>SandboxSignedMissing</title> + <vendor>IcedTea</vendor> + <homepage href="http://icedtea.classpath.org/wiki/IcedTea-Web#Testing_IcedTea-Web"/> + <description>SandboxSignedSandbox</description> + <offline/> + </information> + <resources> + <j2se version="1.4+"/> + <jar href="SandboxSignedSandbox.jar"/> + </resources> + <security> + <all-permissions/> + </security> + <applet-desc + documentBase="." + name="SandboxSignedSandbox" + main-class="SandboxSignedSandbox" + width="250" + height="200"> + </applet-desc> +</jnlp> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/reproducers/signed/SandboxSignedSandbox/resources/SandboxSignedSandbox_security.jnlp Fri Jul 10 19:11:44 2015 +0200 @@ -0,0 +1,56 @@ +<!-- + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea 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 for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + + --> +<?xml version="1.0" encoding="utf-8"?> +<jnlp spec="1.0" href="SandboxSignedSandbox_security.jnlp" codebase="."> + <information> + <title>SandboxSignedMissing</title> + <vendor>IcedTea</vendor> + <homepage href="http://icedtea.classpath.org/wiki/IcedTea-Web#Testing_IcedTea-Web"/> + <description>SandboxSignedSandbox</description> + <offline/> + </information> + <resources> + <j2se version="1.4+"/> + <jar href="SandboxSignedSandbox.jar"/> + </resources> + <security> + <all-permissions/> + </security> + <application-desc main-class="SandboxSignedSandbox"> + </application-desc> +</jnlp> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/reproducers/signed/SandboxSignedSandbox/srcs/META-INF/MANIFEST.MF Fri Jul 10 19:11:44 2015 +0200 @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Permissions: sandbox +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/reproducers/signed/SandboxSignedSandbox/srcs/SandboxSignedSandbox.java Fri Jul 10 19:11:44 2015 +0200 @@ -0,0 +1,57 @@ + +import java.applet.Applet; + +/* AppletTest.java + Copyright (C) 2011 Red Hat, Inc. + + This file is part of IcedTea. + + IcedTea is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 2. + + IcedTea 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 for more details. + + You should have received a copy of the GNU General Public License + along with IcedTea; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. + */ +public class SandboxSignedSandbox extends Applet { + + + @Override + public void init() { + confirm(); + } + + public static void main(String... s) { + confirm(); + } + + private static void confirm() { + System.out.println("*** applet running ***"); + System.out.println(System.getProperty("user.home")); + System.out.println("*** APPLET FINISHED ***"); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/reproducers/signed/SandboxSignedSandbox/testcases/SandboxSignedSandboxTest.java Fri Jul 10 19:11:44 2015 +0200 @@ -0,0 +1,128 @@ + +import java.io.IOException; +import java.util.Arrays; +import net.sourceforge.jnlp.ProcessResult; +import net.sourceforge.jnlp.ServerAccess; +import net.sourceforge.jnlp.annotations.TestInBrowsers; +import net.sourceforge.jnlp.browsertesting.BrowserTest; +import static net.sourceforge.jnlp.browsertesting.BrowserTest.server; +import net.sourceforge.jnlp.browsertesting.Browsers; +import net.sourceforge.jnlp.closinglisteners.AutoErrorClosingListener; +import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; +import net.sourceforge.jnlp.closinglisteners.StringBasedClosingListener; +import net.sourceforge.jnlp.config.DeploymentConfiguration; +import net.sourceforge.jnlp.runtime.ManifestAttributesChecker; +import net.sourceforge.jnlp.tools.DeploymentPropertiesModifier; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +/* AppletTest.java + Copyright (C) 2011 Red Hat, Inc. + + This file is part of IcedTea. + + IcedTea is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 2. + + IcedTea 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 for more details. + + You should have received a copy of the GNU General Public License + along with IcedTea; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. + */ +public class SandboxSignedSandboxTest extends BrowserTest { + + private static final DeploymentPropertiesModifier dpm = new DeploymentPropertiesModifier(); + private static final StringBasedClosingListener aok = new AutoOkClosingListener(); + private static final StringBasedClosingListener aer = new AutoErrorClosingListener(); + private static final String confirmation = "*** applet running ***"; + + + @BeforeClass + public static void setDeploymentManifestPermissionReadingOnly() throws IOException{ + dpm.setProperties(DeploymentConfiguration.KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK, ManifestAttributesChecker.MANIFEST_ATTRIBUTES_CHECK.PERMISSIONS.toString()); + } + + @AfterClass + public static void restoreDeploymentProeprtiees() throws IOException{ + dpm.restoreProperties(); + } + + @Test + //no security dialog + //should run in snadbox (jnlp dont have all-permnissions) + //dont run at all. BUG! + public void javawsAllPermNoSecurity() throws Exception{ + ProcessResult p = server.executeJavawsHeadless("SandboxSignedSandbox.jnlp"); + Assert.assertTrue(p.stdout.contains(confirmation)); + Assert.assertFalse(p.stdout.contains(aok.getCondition())); + Assert.assertTrue(p.stderr.contains(aer.getCondition())); + } + @Test + //no security dialog + //pass, crash, invalid combination all-permissions x sandbox + public void javawsAllPermAllSecurity() throws Exception{ + ProcessResult p = server.executeJavawsHeadless("SandboxSignedSandbox_security.jnlp"); + Assert.assertFalse(p.stdout.contains(confirmation)); + Assert.assertFalse(p.stdout.contains(aok.getCondition())); + Assert.assertTrue(p.stderr.contains(aer.getCondition())); + } + + @Test + //no security dialog + //should run in snadbox (jnlp dont have all-permnissions) + //dont run at all. BUG! + public void javawsAppletAllPermNoSecurity() throws Exception{ + ProcessResult p = server.executeJavaws(Arrays.asList(new String[]{"-headless", "-verbose"}),"SandboxSignedSandbox_applet.jnlp", new AutoOkClosingListener(), new AutoErrorClosingListener()); + Assert.assertTrue(p.stdout.contains(confirmation)); + Assert.assertFalse(p.stdout.contains(aok.getCondition())); + Assert.assertTrue(p.stderr.contains(aer.getCondition()));//applets have exception flused only in verbose mode? strange... + } + @Test + //no security dialog + //pass, crash, invalid combination all-permissions x sandbox + public void javawsAppletAllPermAllSecurity() throws Exception{ + ProcessResult p = server.executeJavawsHeadless("SandboxSignedSandbox_applet_security.jnlp", new AutoOkClosingListener(), new AutoErrorClosingListener()); + Assert.assertFalse(p.stdout.contains(confirmation)); + Assert.assertFalse(p.stdout.contains(aok.getCondition())); + Assert.assertTrue(p.stderr.contains(aer.getCondition())); + } + + @Test + @TestInBrowsers(testIn = Browsers.one) + //no security dialog + //started in sandbox + public void appletAllPermAllSecurity() throws Exception{ + server.getBrowserLocation(); + ProcessResult p = server.executeBrowser("SandboxSignedSandbox.html", ServerAccess.AutoClose.CLOSE_ON_BOTH); + Assert.assertTrue(p.stdout.contains(confirmation)); + Assert.assertFalse(p.stdout.contains(aok.getCondition())); + Assert.assertTrue(p.stderr.contains(aer.getCondition())); + } + + +}