From f84a75fee1efac58cbb49414635a3655b99a4124 Mon Sep 17 00:00:00 2001 From: Andrew Azores Date: Tue, 29 Oct 2013 17:30:18 -0400 Subject: Fix PR1513, signed applets with external main-class support * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: (initializeResources) ask for user approval rather than throwing LaunchException for signed applets with external main-class --- .../sourceforge/jnlp/runtime/JNLPClassLoader.java | 23 ++++++++-------------- 1 file changed, 8 insertions(+), 15 deletions(-) (limited to 'netx/net') diff --git a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java index ed449c7..b2ea5f8 100644 --- a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java +++ b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java @@ -682,33 +682,26 @@ public class JNLPClassLoader extends URLClassLoader { if (jcv.isFullySigned()) { signing = true; - if (!jcv.allJarsSigned() && - !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); // If jar with main class was not found, check available resources - while (!foundMainJar && available != null && available.size() != 0) + while (!foundMainJar && available != null && available.size() != 0) addNextResource(); // If the jar with main class was not found, check extension // jnlp's resources foundMainJar = foundMainJar || hasMainInExtensions(); - // If jar with main class was not found and there are no more - // available jars, throw a LaunchException - if (file.getLaunchInfo() != null) { - if (!foundMainJar - && (available == null || available.size() == 0)) - throw new LaunchException(file, null, R("LSFatal"), - R("LCClient"), R("LCantDetermineMainClass"), - R("LCantDetermineMainClassInfo")); - } + boolean externalMainClass = (file.getLaunchInfo() != null && !foundMainJar + && (available == null || available.size() == 0)); + + if ((!jcv.allJarsSigned() || externalMainClass) && + !SecurityDialogs.showNotAllSignedWarningDialog(file)) + throw new LaunchException(file, null, R("LSFatal"), R("LCClient"), R("LSignedAppJarUsingUnsignedJar"), R("LSignedAppJarUsingUnsignedJarInfo")); // If main jar was found, but a signed JNLP file was not located - if (!isSignedJNLP && foundMainJar) + if (!isSignedJNLP && foundMainJar) file.setSignedJNLPAsMissing(); //user does not trust this publisher -- cgit v1.2.3