diff options
author | Adam Domurad <[email protected]> | 2013-03-26 14:57:33 -0400 |
---|---|---|
committer | Adam Domurad <[email protected]> | 2013-03-26 14:57:33 -0400 |
commit | 58b4d6e3dc3a95cfbc6f369287aca04763522e48 (patch) | |
tree | c31e0146381288222138a667844893106772d87e /netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java | |
parent | c4f2dc4c8dc8c025c5d27c627717a164755986ae (diff) |
Integration of unsigned applet confirmation dialogue.
Diffstat (limited to 'netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java')
-rw-r--r-- | netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java index 484d4f4..983979e 100644 --- a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java +++ b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java @@ -63,6 +63,7 @@ import java.util.jar.JarEntry; import java.util.jar.JarFile; import java.util.jar.Manifest; +import net.sourceforge.jnlp.security.appletextendedsecurity.UnsignedAppletTrustConfirmation; import net.sourceforge.jnlp.AppletDesc; import net.sourceforge.jnlp.ApplicationDesc; import net.sourceforge.jnlp.DownloadOptions; @@ -380,6 +381,13 @@ public class JNLPClassLoader extends URLClassLoader { JNLPClassLoader baseLoader = uniqueKeyToLoader.get(uniqueKey); JNLPClassLoader loader = new JNLPClassLoader(file, policy, mainName); + // If security level is 'high' or greater, we must check if the user allows unsigned applets + // when the JNLPClassLoader is created. We do so here, because doing so in the constructor + // causes unwanted side-effects for some applets + if (!loader.getSigning() && file instanceof PluginBridge) { + UnsignedAppletTrustConfirmation.checkUnsignedWithUserIfRequired((PluginBridge)file); + } + // New loader init may have caused extentions to create a // loader for this unique key. Check. JNLPClassLoader extLoader = uniqueKeyToLoader.get(uniqueKey); @@ -596,9 +604,9 @@ public class JNLPClassLoader extends URLClassLoader { JARDesc jars[] = resources.getJARs(); - if (jars == null || jars.length == 0) { + if (jars.length == 0) { - boolean allSigned = true; + boolean allSigned = (loaders.length > 1) /* has extensions */; for (int i = 1; i < loaders.length; i++) { if (!loaders[i].getSigning()) { allSigned = false; @@ -681,7 +689,6 @@ public class JNLPClassLoader extends URLClassLoader { !SecurityDialogs.showNotAllSignedWarningDialog(file)) throw new LaunchException(file, null, R("LSFatal"), R("LCClient"), R("LSignedAppJarUsingUnsignedJar"), R("LSignedAppJarUsingUnsignedJarInfo")); - // Check for main class in the downloaded jars, and check/verify signed JNLP fill checkForMain(initialJars); @@ -718,9 +725,9 @@ public class JNLPClassLoader extends URLClassLoader { } } else { + // Otherwise this jar is simply unsigned -- make sure to ask + // for permission on certain actions signing = false; - //otherwise this jar is simply unsigned -- make sure to ask - //for permission on certain actions } } |