/hg/icedtea-web: 2 new changesets
aazores at icedtea.classpath.org
aazores at icedtea.classpath.org
Thu Mar 20 19:23:51 UTC 2014
changeset 674128ef4394 in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=674128ef4394
author: Andrew Azores <aazores at redhat.com>
date: Thu Mar 20 15:20:58 2014 -0400
SecurityDelegate addPermission
* netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: (SecurityDelegate
addPermission, addPermissions) new methods. (SecurityDelegateImpl addPermission,
addPermissions) implement previous.
changeset fb2309dfa598 in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=fb2309dfa598
author: Andrew Azores <aazores at redhat.com>
date: Thu Mar 20 15:23:33 2014 -0400
CertWarningPane SecurityDelegate reference
Passing a reference to SecurityDelegate to CertWarningPane, so that UI
elements can be added later to allow the applet to be run Sandboxed + some
temporary permissions
* netx/net/sourceforge/jnlp/security/JNLPAppVerifier.java: (checkTrustWithUser)
pass SecurityDelegate reference to SecurityDialogs.showCertWarningDialog
* netx/net/sourceforge/jnlp/security/PluginAppVerifier.java: same
* netx/net/sourceforge/jnlp/security/SecurityDialog.java: pass SecurityDelegate
reference from extras into CertWarningPane constructor
* netx/net/sourceforge/jnlp/security/SecurityDialogs.java: (showCertWarningDialog)
added SecurityDelegate parameter, add to extras array.
* netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java: (askUser)
pass null for SecurityDelegate reference
* netx/net/sourceforge/jnlp/security/dialogs/CertWarningPane.java: (CertWarningPane)
added SecurityDelegate constructor parameter and (securityDelegate) field
diffstat:
ChangeLog | 25 ++++++++++
netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java | 23 +++++++++
netx/net/sourceforge/jnlp/security/JNLPAppVerifier.java | 2 +-
netx/net/sourceforge/jnlp/security/PluginAppVerifier.java | 2 +-
netx/net/sourceforge/jnlp/security/SecurityDialog.java | 3 +-
netx/net/sourceforge/jnlp/security/SecurityDialogs.java | 8 ++-
netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java | 2 +-
netx/net/sourceforge/jnlp/security/dialogs/CertWarningPane.java | 5 +-
8 files changed, 62 insertions(+), 8 deletions(-)
diffs (187 lines):
diff -r cea32875903d -r fb2309dfa598 ChangeLog
--- a/ChangeLog Thu Mar 20 16:55:12 2014 +0100
+++ b/ChangeLog Thu Mar 20 15:23:33 2014 -0400
@@ -1,3 +1,28 @@
+2014-03-20 Andrew Azores <aazores at redhat.com>
+
+ Passing a reference to SecurityDelegate to CertWarningPane, so that UI
+ elements can be added later to allow the applet to be run Sandboxed + some
+ temporary permissions
+ * netx/net/sourceforge/jnlp/security/JNLPAppVerifier.java: (checkTrustWithUser)
+ pass SecurityDelegate reference to SecurityDialogs.showCertWarningDialog
+ * netx/net/sourceforge/jnlp/security/PluginAppVerifier.java: same
+ * netx/net/sourceforge/jnlp/security/SecurityDialog.java: pass SecurityDelegate
+ reference from extras into CertWarningPane constructor
+ * netx/net/sourceforge/jnlp/security/SecurityDialogs.java: (showCertWarningDialog)
+ added SecurityDelegate parameter, add to extras array.
+ * netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java: (askUser)
+ pass null for SecurityDelegate reference
+ * netx/net/sourceforge/jnlp/security/dialogs/CertWarningPane.java: (CertWarningPane)
+ added SecurityDelegate constructor parameter and (securityDelegate) field
+
+2014-03-20 Andrew Azores <aazores at redhat.com>
+
+ SecurityDelegate can be used to add permissions to JNLPClassLoader during
+ run. This is useful for adding temporary extra permissions to an applet.
+ * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: (SecurityDelegate
+ addPermission, addPermissions) new methods. (SecurityDelegateImpl addPermission,
+ addPermissions) implement previous.
+
2014-03-20 Jiri Vanek <jvanek at redhat.com>
Clear cache function made more visible.
diff -r cea32875903d -r fb2309dfa598 netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
--- a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Thu Mar 20 16:55:12 2014 +0100
+++ b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Thu Mar 20 15:23:33 2014 -0400
@@ -2270,6 +2270,12 @@
public void setRunInSandbox() throws LaunchException;
public boolean getRunInSandbox();
+
+ public void addPermission(final Permission perm);
+
+ public void addPermissions(final PermissionCollection perms);
+
+ public void addPermissions(final Collection<Permission> perms);
}
/**
@@ -2406,6 +2412,23 @@
return this.promptedForSandbox;
}
+ public void addPermission(final Permission perm) {
+ classLoader.addPermission(perm);
+ }
+
+ public void addPermissions(final PermissionCollection perms) {
+ Enumeration<Permission> e = perms.elements();
+ while (e.hasMoreElements()) {
+ addPermission(e.nextElement());
+ }
+ }
+
+ public void addPermissions(final Collection<Permission> perms) {
+ for (final Permission perm : perms) {
+ addPermission(perm);
+ }
+ }
+
}
diff -r cea32875903d -r fb2309dfa598 netx/net/sourceforge/jnlp/security/JNLPAppVerifier.java
--- a/netx/net/sourceforge/jnlp/security/JNLPAppVerifier.java Thu Mar 20 16:55:12 2014 +0100
+++ b/netx/net/sourceforge/jnlp/security/JNLPAppVerifier.java Thu Mar 20 15:23:33 2014 -0400
@@ -121,7 +121,7 @@
}
AppletAction action = SecurityDialogs.showCertWarningDialog(
- dialogType, file, jcv);
+ dialogType, file, jcv, securityDelegate);
if (action != AppletAction.CANCEL) {
if (action == AppletAction.SANDBOX) {
securityDelegate.setRunInSandbox();
diff -r cea32875903d -r fb2309dfa598 netx/net/sourceforge/jnlp/security/PluginAppVerifier.java
--- a/netx/net/sourceforge/jnlp/security/PluginAppVerifier.java Thu Mar 20 16:55:12 2014 +0100
+++ b/netx/net/sourceforge/jnlp/security/PluginAppVerifier.java Thu Mar 20 15:23:33 2014 -0400
@@ -168,7 +168,7 @@
}
AppletAction action = SecurityDialogs.showCertWarningDialog(
- dialogType, file, jcv);
+ dialogType, file, jcv, securityDelegate);
if (action != AppletAction.CANCEL) {
if (action == AppletAction.SANDBOX) {
securityDelegate.setRunInSandbox();
diff -r cea32875903d -r fb2309dfa598 netx/net/sourceforge/jnlp/security/SecurityDialog.java
--- a/netx/net/sourceforge/jnlp/security/SecurityDialog.java Thu Mar 20 16:55:12 2014 +0100
+++ b/netx/net/sourceforge/jnlp/security/SecurityDialog.java Thu Mar 20 15:23:33 2014 -0400
@@ -48,6 +48,7 @@
import javax.swing.JDialog;
import net.sourceforge.jnlp.JNLPFile;
+import net.sourceforge.jnlp.runtime.JNLPClassLoader.SecurityDelegate;
import net.sourceforge.jnlp.security.SecurityDialogs.AccessType;
import net.sourceforge.jnlp.security.SecurityDialogs.DialogType;
import net.sourceforge.jnlp.security.dialogs.AccessWarningPane;
@@ -302,7 +303,7 @@
private void installPanel() {
if (dialogType == DialogType.CERT_WARNING)
- panel = new CertWarningPane(this, this.certVerifier);
+ 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)
diff -r cea32875903d -r fb2309dfa598 netx/net/sourceforge/jnlp/security/SecurityDialogs.java
--- a/netx/net/sourceforge/jnlp/security/SecurityDialogs.java Thu Mar 20 16:55:12 2014 +0100
+++ b/netx/net/sourceforge/jnlp/security/SecurityDialogs.java Thu Mar 20 15:23:33 2014 -0400
@@ -52,10 +52,11 @@
import net.sourceforge.jnlp.JNLPFile;
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.ExecuteAppletAction;
+import net.sourceforge.jnlp.security.dialogs.apptrustwarningpanel.AppTrustWarningPanel.AppSigningWarningAction;
import net.sourceforge.jnlp.util.UrlUtils;
-import net.sourceforge.jnlp.security.dialogs.apptrustwarningpanel.AppTrustWarningPanel.AppSigningWarningAction;
-import net.sourceforge.jnlp.security.appletextendedsecurity.ExecuteAppletAction;
/**
* <p>
@@ -197,7 +198,7 @@
* user did not accept running the applet
*/
public static AppletAction showCertWarningDialog(AccessType accessType,
- JNLPFile file, CertVerifier certVerifier) {
+ JNLPFile file, CertVerifier certVerifier, SecurityDelegate securityDelegate) {
if (!shouldPromptUser()) {
return AppletAction.CANCEL;
@@ -208,6 +209,7 @@
message.accessType = accessType;
message.file = file;
message.certVerifier = certVerifier;
+ message.extras = new Object[] { securityDelegate };
Object selectedValue = getUserResponse(message);
diff -r cea32875903d -r fb2309dfa598 netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java
--- a/netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java Thu Mar 20 16:55:12 2014 +0100
+++ b/netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java Thu Mar 20 15:23:33 2014 -0400
@@ -425,7 +425,7 @@
AccessType.UNVERIFIED, null,
new HttpsCertVerifier(chain, authType,
isTrusted, hostMatched,
- hostName)) == AppletAction.RUN;
+ hostName), null) == AppletAction.RUN;
}
});
}
diff -r cea32875903d -r fb2309dfa598 netx/net/sourceforge/jnlp/security/dialogs/CertWarningPane.java
--- a/netx/net/sourceforge/jnlp/security/dialogs/CertWarningPane.java Thu Mar 20 16:55:12 2014 +0100
+++ b/netx/net/sourceforge/jnlp/security/dialogs/CertWarningPane.java Thu Mar 20 15:23:33 2014 -0400
@@ -65,6 +65,7 @@
import net.sourceforge.jnlp.JNLPFile;
import net.sourceforge.jnlp.PluginBridge;
+import net.sourceforge.jnlp.runtime.JNLPClassLoader.SecurityDelegate;
import net.sourceforge.jnlp.security.CertVerifier;
import net.sourceforge.jnlp.security.CertificateUtils;
import net.sourceforge.jnlp.security.HttpsCertVerifier;
@@ -89,10 +90,12 @@
JCheckBox alwaysTrust;
CertVerifier certVerifier;
+ SecurityDelegate securityDelegate;
- public CertWarningPane(SecurityDialog x, CertVerifier certVerifier) {
+ public CertWarningPane(SecurityDialog x, CertVerifier certVerifier, SecurityDelegate securityDelegate) {
super(x, certVerifier);
this.certVerifier = certVerifier;
+ this.securityDelegate = securityDelegate;
addComponents();
}
More information about the distro-pkg-dev
mailing list