/hg/icedtea-web: AppletSecurityActions, ExecuteAppletAction, App...
jvanek at icedtea.classpath.org
jvanek at icedtea.classpath.org
Thu Jun 11 11:25:04 UTC 2015
changeset 21aca3386c4f in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=21aca3386c4f
author: Jiri Vanek <jvanek at redhat.com>
date: Thu Jun 11 13:24:54 2015 +0200
AppletSecurityActions, ExecuteAppletAction, AppletSecurityActionsTest moved to remember package
diffstat:
ChangeLog | 45 ++
netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletActionTableModel.java | 4 +-
netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletsTrustingListPanel.java | 4 +-
netx/net/sourceforge/jnlp/security/SecurityDialog.java | 71 ++-
netx/net/sourceforge/jnlp/security/SecurityDialogs.java | 4 +-
netx/net/sourceforge/jnlp/security/appletextendedsecurity/AppletSecurityActions.java | 166 ----------
netx/net/sourceforge/jnlp/security/appletextendedsecurity/ExecuteAppletAction.java | 110 ------
netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletActionEntry.java | 7 +-
netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfirmation.java | 2 +
netx/net/sourceforge/jnlp/security/appletextendedsecurity/impl/UnsignedAppletActionStorageExtendedImpl.java | 4 +-
netx/net/sourceforge/jnlp/security/appletextendedsecurity/impl/UnsignedAppletActionStorageImpl.java | 2 +-
netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/AppTrustWarningPanel.java | 2 +-
netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/MatchingALACAttributePanel.java | 4 +-
netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/PartiallySignedAppTrustWarningPanel.java | 4 +-
netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/UnsignedAppletTrustWarningPanel.java | 4 +-
netx/net/sourceforge/jnlp/security/dialogs/remember/AppSigningWarningAction.java | 2 -
netx/net/sourceforge/jnlp/security/dialogs/remember/AppletSecurityActions.java | 166 ++++++++++
netx/net/sourceforge/jnlp/security/dialogs/remember/ExecuteAppletAction.java | 110 ++++++
netx/net/sourceforge/jnlp/security/dialogs/remember/RememberPanel.java | 1 -
tests/netx/unit/net/sourceforge/jnlp/security/SecurityDialogsTest.java | 3 +-
tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/AppletSecurityActionsTest.java | 158 ---------
tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/impl/UnsignedAppletActionStorageImplTest.java | 4 +-
tests/netx/unit/net/sourceforge/jnlp/security/dialogs/remember/AppletSecurityActionsTest.java | 160 +++++++++
23 files changed, 549 insertions(+), 488 deletions(-)
diffs (truncated from 1253 to 500 lines):
diff -r b2406e30f04b -r 21aca3386c4f ChangeLog
--- a/ChangeLog Thu Jun 11 12:51:00 2015 +0200
+++ b/ChangeLog Thu Jun 11 13:24:54 2015 +0200
@@ -1,3 +1,48 @@
+2015-06-11 Jiri Vanek <jvanek at redhat.com>
+
+ AppletSecurityActions, ExecuteAppletAction, AppletSecurityActionsTest moved to remember package
+ * netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletActionTableModel.java:
+ adapted imports
+ * netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletsTrustingListPanel.java:
+ same
+ * netx/net/sourceforge/jnlp/security/SecurityDialogs.java:
+ same
+ * netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfirmation.java:
+ same
+ * netx/net/sourceforge/jnlp/security/appletextendedsecurity/impl/UnsignedAppletActionStorageExtendedImpl.java:
+ same
+ * netx/net/sourceforge/jnlp/security/appletextendedsecurity/impl/UnsignedAppletActionStorageImpl.java:
+ same
+ * netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/AppTrustWarningPanel.java:
+ same
+ * netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/MatchingALACAttributePanel.java:
+ same
+ * netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/PartiallySignedAppTrustWarningPanel.java:
+ same
+ * netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/UnsignedAppletTrustWarningPanel.java:
+ same
+ * netx/net/sourceforge/jnlp/security/dialogs/remember/AppSigningWarningAction.java:
+ same
+ * netx/net/sourceforge/jnlp/security/dialogs/remember/RememberPanel.java
+ same
+ * tests/netx/unit/net/sourceforge/jnlp/security/SecurityDialogsTest.java
+ same
+ * netx/net/sourceforge/jnlp/security/SecurityDialog.java: (getPanel) extracted
+ from (installPanel). It now throws exception if panel is about to be null.
+ * netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletActionEntry.java:
+ used diamond
+ * net/sourceforge/jnlp/security/appletextendedsecurity/AppletSecurityActions.java:
+ moved to
+ * netx/net/sourceforge/jnlp/security/dialogs/remember/AppletSecurityActions.java:
+ here
+ * netx/net/sourceforge/jnlp/security/appletextendedsecurity/ExecuteAppletAction.java:
+ moved to
+ * netx/net/sourceforge/jnlp/security/dialogs/remember/ExecuteAppletAction.java:
+ here
+ * tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/AppletSecurityActionsTest.java:
+ moved to
+ * tests/netx/unit/net/sourceforge/jnlp/security/dialogs/remember/AppletSecurityActionsTest.java:
+ here
2015-06-11 Jiri Vanek <jvanek at redhat.com>
make jnlpfile nearly mandatory argument of message and adapt various re-declarations accordingly
diff -r b2406e30f04b -r 21aca3386c4f netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletActionTableModel.java
--- a/netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletActionTableModel.java Thu Jun 11 12:51:00 2015 +0200
+++ b/netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletActionTableModel.java Thu Jun 11 13:24:54 2015 +0200
@@ -39,8 +39,8 @@
import javax.swing.event.TableModelEvent;
import javax.swing.table.AbstractTableModel;
import net.sourceforge.jnlp.runtime.Translator;
-import net.sourceforge.jnlp.security.appletextendedsecurity.AppletSecurityActions;
-import net.sourceforge.jnlp.security.appletextendedsecurity.ExecuteAppletAction;
+import net.sourceforge.jnlp.security.dialogs.remember.AppletSecurityActions;
+import net.sourceforge.jnlp.security.dialogs.remember.ExecuteAppletAction;
import net.sourceforge.jnlp.security.appletextendedsecurity.UnsignedAppletActionEntry;
import net.sourceforge.jnlp.security.appletextendedsecurity.UrlRegEx;
import net.sourceforge.jnlp.security.appletextendedsecurity.impl.UnsignedAppletActionStorageExtendedImpl;
diff -r b2406e30f04b -r 21aca3386c4f netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletsTrustingListPanel.java
--- a/netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletsTrustingListPanel.java Thu Jun 11 12:51:00 2015 +0200
+++ b/netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletsTrustingListPanel.java Thu Jun 11 13:24:54 2015 +0200
@@ -87,9 +87,9 @@
import net.sourceforge.jnlp.config.DeploymentConfiguration;
import net.sourceforge.jnlp.config.PathsAndFiles;
import net.sourceforge.jnlp.runtime.Translator;
-import net.sourceforge.jnlp.security.appletextendedsecurity.AppletSecurityActions;
+import net.sourceforge.jnlp.security.dialogs.remember.AppletSecurityActions;
import net.sourceforge.jnlp.security.appletextendedsecurity.AppletSecurityLevel;
-import net.sourceforge.jnlp.security.appletextendedsecurity.ExecuteAppletAction;
+import net.sourceforge.jnlp.security.dialogs.remember.ExecuteAppletAction;
import net.sourceforge.jnlp.security.appletextendedsecurity.ExtendedAppletSecurityHelp;
import net.sourceforge.jnlp.security.appletextendedsecurity.UnsignedAppletActionEntry;
import net.sourceforge.jnlp.security.appletextendedsecurity.UrlRegEx;
diff -r b2406e30f04b -r 21aca3386c4f netx/net/sourceforge/jnlp/security/SecurityDialog.java
--- a/netx/net/sourceforge/jnlp/security/SecurityDialog.java Thu Jun 11 12:51:00 2015 +0200
+++ b/netx/net/sourceforge/jnlp/security/SecurityDialog.java Thu Jun 11 13:24:54 2015 +0200
@@ -293,36 +293,53 @@
return cert;
}
- /**
+ /*
+ * find appropriate JPanel to this Dialog, based on {@link DialogType}.
+ */
+ private SecurityDialogPanel getPanel() {
+ return getPanel(this);
+ }
+
+ /*
+ * find appropriate JPanel to given Dialog, based on {@link DialogType}.
+ */
+ private static SecurityDialogPanel getPanel(SecurityDialog sd) {
+ SecurityDialogPanel lpanel = null;
+ if (sd.dialogType == DialogType.CERT_WARNING) {
+ lpanel = new CertWarningPane(sd, sd.certVerifier, (SecurityDelegate) sd.extras[0]);
+ } else if (sd.dialogType == DialogType.MORE_INFO) {
+ lpanel = new MoreInfoPane(sd, sd.certVerifier);
+ } else if (sd.dialogType == DialogType.CERT_INFO) {
+ lpanel = new CertsInfoPane(sd, sd.certVerifier);
+ } else if (sd.dialogType == DialogType.SINGLE_CERT_INFO) {
+ lpanel = new SingleCertInfoPane(sd, sd.certVerifier);
+ } else if (sd.dialogType == DialogType.ACCESS_WARNING) {
+ lpanel = new AccessWarningPane(sd, sd.extras, sd.certVerifier);
+ } else if (sd.dialogType == DialogType.APPLET_WARNING) {
+ lpanel = new AppletWarningPane(sd, sd.certVerifier);
+ } else if (sd.dialogType == DialogType.PARTIALLYSIGNED_WARNING) {
+ lpanel = AppTrustWarningDialog.partiallySigned(sd, sd.file, (SecurityDelegate) sd.extras[0]);
+ } else if (sd.dialogType == DialogType.UNSIGNED_WARNING) {
+ lpanel = AppTrustWarningDialog.unsigned(sd, sd.file); // Only necessary for applets on 'high security' or above
+ } else if (sd.dialogType == DialogType.AUTHENTICATION) {
+ lpanel = new PasswordAuthenticationPane(sd, sd.extras);
+ } else if (sd.dialogType == DialogType.UNSIGNED_EAS_NO_PERMISSIONS_WARNING) {
+ lpanel = new MissingPermissionsAttributePanel(sd, sd.file.getTitle(), sd.file.getCodeBase().toExternalForm());
+ } else if (sd.dialogType == DialogType.MISSING_ALACA) {
+ lpanel = new MissingALACAttributePanel(sd, sd.file.getTitle(), (String) sd.extras[0], (String) sd.extras[1]);
+ } else if (sd.dialogType == DialogType.MATCHING_ALACA) {
+ lpanel = AppTrustWarningDialog.matchingAlaca(sd, sd.file, (String) sd.extras[0], (String) sd.extras[1]);
+ } else {
+ throw new RuntimeException("Unknown value of " + sd.dialogType + ". Panel will be null. Tahts not allowed.");
+ }
+ return lpanel;
+ }
+
+ /*
* Adds the appropriate JPanel to this Dialog, based on {@link DialogType}.
*/
private void installPanel() {
-
- if (dialogType == DialogType.CERT_WARNING)
- panel = new CertWarningPane(this, this.certVerifier, (SecurityDelegate) extras[0]);
- else if (dialogType == DialogType.MORE_INFO)
- panel = new MoreInfoPane(this, this.certVerifier);
- else if (dialogType == DialogType.CERT_INFO)
- panel = new CertsInfoPane(this, this.certVerifier);
- else if (dialogType == DialogType.SINGLE_CERT_INFO)
- panel = new SingleCertInfoPane(this, this.certVerifier);
- else if (dialogType == DialogType.ACCESS_WARNING)
- panel = new AccessWarningPane(this, extras, this.certVerifier);
- else if (dialogType == DialogType.APPLET_WARNING)
- panel = new AppletWarningPane(this, this.certVerifier);
- else if (dialogType == DialogType.PARTIALLYSIGNED_WARNING)
- panel = AppTrustWarningDialog.partiallySigned(this, file, (SecurityDelegate) extras[0]);
- else if (dialogType == DialogType.UNSIGNED_WARNING) // Only necessary for applets on 'high security' or above
- panel = AppTrustWarningDialog.unsigned(this, file);
- else if (dialogType == DialogType.AUTHENTICATION)
- panel = new PasswordAuthenticationPane(this, extras);
- else if (dialogType == DialogType.UNSIGNED_EAS_NO_PERMISSIONS_WARNING)
- panel = new MissingPermissionsAttributePanel(this, file.getTitle(), file.getCodeBase().toExternalForm());
- else if (dialogType == DialogType.MISSING_ALACA)
- panel = new MissingALACAttributePanel(this, file.getTitle(), (String) extras[0], (String) extras[1]);
- else if (dialogType == DialogType.MATCHING_ALACA)
- panel = AppTrustWarningDialog.matchingAlaca(this, file, (String) extras[0], (String) extras[1]);
-
+ panel = getPanel();
add(panel, BorderLayout.CENTER);
}
diff -r b2406e30f04b -r 21aca3386c4f netx/net/sourceforge/jnlp/security/SecurityDialogs.java
--- a/netx/net/sourceforge/jnlp/security/SecurityDialogs.java Thu Jun 11 12:51:00 2015 +0200
+++ b/netx/net/sourceforge/jnlp/security/SecurityDialogs.java Thu Jun 11 13:24:54 2015 +0200
@@ -54,8 +54,6 @@
import net.sourceforge.jnlp.config.DeploymentConfiguration;
import net.sourceforge.jnlp.runtime.JNLPClassLoader.SecurityDelegate;
import net.sourceforge.jnlp.runtime.JNLPRuntime;
-import net.sourceforge.jnlp.security.appletextendedsecurity.AppletSecurityActions;
-import net.sourceforge.jnlp.security.appletextendedsecurity.ExecuteAppletAction;
import net.sourceforge.jnlp.security.appletextendedsecurity.UnsignedAppletTrustConfirmation;
import static net.sourceforge.jnlp.security.appletextendedsecurity.UnsignedAppletTrustConfirmation.getStoredAction;
import net.sourceforge.jnlp.security.dialogresults.AccessWarningPaneComplexReturn;
@@ -63,6 +61,8 @@
import net.sourceforge.jnlp.security.dialogresults.NamePassword;
import net.sourceforge.jnlp.security.dialogresults.YesNoSandbox;
import net.sourceforge.jnlp.security.dialogs.remember.AppSigningWarningAction;
+import net.sourceforge.jnlp.security.dialogs.remember.AppletSecurityActions;
+import net.sourceforge.jnlp.security.dialogs.remember.ExecuteAppletAction;
import net.sourceforge.jnlp.security.dialogs.remember.RememberPanel;
import net.sourceforge.jnlp.util.UrlUtils;
import net.sourceforge.jnlp.util.logging.OutputController;
diff -r b2406e30f04b -r 21aca3386c4f netx/net/sourceforge/jnlp/security/appletextendedsecurity/AppletSecurityActions.java
--- a/netx/net/sourceforge/jnlp/security/appletextendedsecurity/AppletSecurityActions.java Thu Jun 11 12:51:00 2015 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,166 +0,0 @@
-/* Copyright (C) 2014 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.
- */
-package net.sourceforge.jnlp.security.appletextendedsecurity;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-public class AppletSecurityActions implements Iterable<ExecuteAppletAction>{
-
- private final List<ExecuteAppletAction> actions = new ArrayList<>();
- public static final int UNSIGNED_APPLET_ACTION = 0;
- public static final int MATCHING_ALACA_ACTION = 1;
- /** well this si not nice. We can iterate through all the records to find
- * longest remembered item, but it is unnecessary overhead. The new record is
- * added willingly with some effort. Should be easy to inc also this
- */
- public static final int REMEMBER_COLUMNS_COUNT = /*2*/
- Collections.max(Arrays.asList(UNSIGNED_APPLET_ACTION, MATCHING_ALACA_ACTION))+1;
-
-
- public static AppletSecurityActions createDefault() {
- AppletSecurityActions asas = new AppletSecurityActions();
- asas.setUnsignedAppletAction(ExecuteAppletAction.UNSET);
- asas.setMatchingAlacaAction(ExecuteAppletAction.UNSET);
- return asas;
- }
- /*
- * quick setup method when new item , with one action, is added
- */
- public static AppletSecurityActions fromAction(int id, ExecuteAppletAction s) {
- if (s == null){
- s = ExecuteAppletAction.UNSET;
- }
- AppletSecurityActions asas = new AppletSecurityActions();
- asas.setAction(id, s);
- return asas;
- }
-
-
- static AppletSecurityActions fromString(String s) {
- if (s == null) {
- s = "";
- }
- s = s.trim(); //to not return on leading space, may be dangerous,
- //but the s shouldbe already trimmed before bubbling here.
- //does " A" means UNSET(1)+ALWAYS(2) or ALWAYS(1)+UNSET(2)
- //or UNSET(1)+UNSET(2)?
- AppletSecurityActions asas = new AppletSecurityActions();
- for (char x : s.toCharArray()){
- if (Character.isWhitespace(x)){
- break;
- }
- asas.actions.add(ExecuteAppletAction.fromChar(x));
- }
- return asas;
- }
-
- public ExecuteAppletAction getAction(int i) {
- if (i>= actions.size()){
- return ExecuteAppletAction.UNSET;
- }
- return actions.get(i);
- }
-
- public void setAction(int i, ExecuteAppletAction a) {
- while (actions.size() <= i){
- actions.add(ExecuteAppletAction.UNSET);
- }
- actions.set(i,a);
- }
-
-
- public ExecuteAppletAction getUnsignedAppletAction() {
- return getAction(UNSIGNED_APPLET_ACTION);
- }
-
- public void setUnsignedAppletAction(ExecuteAppletAction a) {
- setAction(UNSIGNED_APPLET_ACTION,a);
- }
-
-
- public ExecuteAppletAction getMatchingAlacaAction() {
- return getAction(MATCHING_ALACA_ACTION);
- }
-
- public void setMatchingAlacaAction(ExecuteAppletAction a) {
- setAction(MATCHING_ALACA_ACTION, a);
- }
-
- @Override
- public String toString() {
- return toShortString();
- }
-
- public String toLongString() {
- StringBuilder sb = new StringBuilder();
- for (ExecuteAppletAction executeAppletAction : actions) {
- sb.append(executeAppletAction.toString()).append("; ");
- }
- return sb.toString();
- }
-
-
- public String toShortString() {
- StringBuilder sb = new StringBuilder();
- for (ExecuteAppletAction executeAppletAction : actions) {
- sb.append(executeAppletAction.toChar());
- }
- return sb.toString();
- }
-
- public int getRealCount() {
- return actions.size();
- }
-
-
- /**
- * stub for testing
- * @return
- */
- List<ExecuteAppletAction> getActions() {
- return actions;
- }
-
- @Override
- public Iterator<ExecuteAppletAction> iterator() {
- return actions.iterator();
- }
-
-}
diff -r b2406e30f04b -r 21aca3386c4f netx/net/sourceforge/jnlp/security/appletextendedsecurity/ExecuteAppletAction.java
--- a/netx/net/sourceforge/jnlp/security/appletextendedsecurity/ExecuteAppletAction.java Thu Jun 11 12:51:00 2015 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,110 +0,0 @@
-/* Copyright (C) 2013 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.
- */
-package net.sourceforge.jnlp.security.appletextendedsecurity;
-
-import net.sourceforge.jnlp.runtime.Translator;
-
-public enum ExecuteAppletAction {
-
- ALWAYS, NEVER, YES, SANDBOX, NO, UNSET;
-
- public String toChar() {
- switch (this) {
- case ALWAYS:
- return "A";
- case NEVER:
- return "N";
- case YES:
- return "y";
- case SANDBOX:
- return "s";
- case NO:
- return "n";
- case UNSET:
- return "X";
- }
- throw new RuntimeException("Unknown ExecuteUnsignedApplet");
- }
-
- public String toExplanation() {
- switch (this) {
- case ALWAYS:
- return Translator.R("APPEXTSECunsignedAppletActionAlways");
- case NEVER:
- return Translator.R("APPEXTSECunsignedAppletActionNever");
- case YES:
- return Translator.R("APPEXTSECunsignedAppletActionYes");
- case SANDBOX:
- return Translator.R("APPEXTSECunsignedAppletActionSandbox");
- case NO:
- return Translator.R("APPEXTSECunsignedAppletActionNo");
- case UNSET:
- return Translator.R("APPEXTSECunsetAppletAction");
- }
- throw new RuntimeException("Unknown UnsignedAppletAction");
- }
-
- public static ExecuteAppletAction fromString(String s) {
- if (s.length() == 0){
- throw new RuntimeException("Undefined zero-length ExecuteAppletAction String representatio");
- }
- return fromChar(s.charAt(0));
-
- }
-
- public static ExecuteAppletAction fromChar(char s) {
- switch (s) {
- case 'A':
- return ExecuteAppletAction.ALWAYS;
- case 'N':
- return ExecuteAppletAction.NEVER;
- case 'y':
- return ExecuteAppletAction.YES;
- case 's':
- return ExecuteAppletAction.SANDBOX;
- case 'n':
- return ExecuteAppletAction.NO;
- case 'X':
- return ExecuteAppletAction.UNSET;
- }
- throw new RuntimeException("Unknown ExecuteUnsignedApplet for " + s);
- }
-
- @Override
- public String toString() {
- return toChar() + " - " + toExplanation();
- }
-}
diff -r b2406e30f04b -r 21aca3386c4f netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletActionEntry.java
--- a/netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletActionEntry.java Thu Jun 11 12:51:00 2015 +0200
+++ b/netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletActionEntry.java Thu Jun 11 13:24:54 2015 +0200
@@ -35,6 +35,7 @@
*/
package net.sourceforge.jnlp.security.appletextendedsecurity;
+import net.sourceforge.jnlp.security.dialogs.remember.AppletSecurityActions;
import java.io.IOException;
import java.io.Writer;
import java.util.ArrayList;
@@ -172,14 +173,12 @@
return null;
}
String[] items = commedArchives.trim().split(",");
- List<String> r = new ArrayList<String>(items.length);
- for (int i = 0; i < items.length; i++) {
- String string = items[i];
+ List<String> r = new ArrayList<>(items.length);
+ for (String string : items) {
if (string.trim().isEmpty()) {
continue;
}
r.add(string);
-
}
return r;
diff -r b2406e30f04b -r 21aca3386c4f netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfirmation.java
--- a/netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfirmation.java Thu Jun 11 12:51:00 2015 +0200
More information about the distro-pkg-dev
mailing list