# HG changeset patch # User Jiri Vanek # Date 1341316289 -7200 # Node ID d5cec52b3c5bff59018b493c3f01d8d51948e613 # Parent 01ed07070c3c0711a2a0adb2dfeec17bfc34b964 Last hope for not downloaded resources to be verified diff -r 01ed07070c3c -r d5cec52b3c5b ChangeLog --- a/ChangeLog Tue Jul 03 13:38:23 2012 +0200 +++ b/ChangeLog Tue Jul 03 13:51:29 2012 +0200 @@ -1,4 +1,15 @@ -2012-05-18 Jiri Vanek +2012-07-23 Jiri Vanek + + Last hope for not downloaded resources to be verified + * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: + (getCodeSourceSecurity): will now try to download and verify resource + which was downloaded outside of netx. + (alreadyTried) set for memory of once tried resources to not try again + * NEWS: mentioned RH816592 + * netx/net/sourceforge/jnlp/resources/Messages.properties: backported + necessary resources (LNoSecInstance) and (LCertFoundIn) + +2012-07-09 Jiri Vanek Fixed behavior when encoded/characters needed encoding included in url * NEWS: mentioned PR811 diff -r 01ed07070c3c -r d5cec52b3c5b NEWS --- a/NEWS Tue Jul 03 13:38:23 2012 +0200 +++ b/NEWS Tue Jul 03 13:51:29 2012 +0200 @@ -12,6 +12,7 @@ * NetX - PR898: signed applications with big jnlp-file doesn't start (webstart affect like "frozen") - PR811: javaws is not handling urls with spaces (and other characters needing encoding) correctly + - 816592: icedtea-web not loading GeoGebra java applets in Firefox or Chrome * Plugin - PR863: Error passing strings to applet methods in Chromium - PR895: IcedTea-Web searches for missing classes on each loadClass or findClass diff -r 01ed07070c3c -r d5cec52b3c5b netx/net/sourceforge/jnlp/resources/Messages.properties --- a/netx/net/sourceforge/jnlp/resources/Messages.properties Tue Jul 03 13:38:23 2012 +0200 +++ b/netx/net/sourceforge/jnlp/resources/Messages.properties Tue Jul 03 13:51:29 2012 +0200 @@ -81,7 +81,9 @@ LSignedAppJarUsingUnsignedJar=Signed application using unsigned jars. LSignedAppJarUsingUnsignedJarInfo=The main application jar is signed, but some of the jars it is using aren't. LSignedJNLPFileDidNotMatch=The signed JNLP file did not match the launching JNLP file. - +LNoSecInstance=Error: No security instance for {0}. The application may have trouble continuing +LCertFoundIn={0} found in cacerts ({1}) + JNotApplet=File is not an applet. JNotApplication=File is not an application. JNotComponent=File is not a component. diff -r 01ed07070c3c -r d5cec52b3c5b netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java --- a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Tue Jul 03 13:38:23 2012 +0200 +++ b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Tue Jul 03 13:51:29 2012 +0200 @@ -167,6 +167,9 @@ /** Map of specific original (remote) CodeSource Urls to securitydesc */ private HashMap jarLocationSecurityMap = new HashMap(); + + /*Set to prevent once tried-to-get resources to be tried again*/ + private Set alreadyTried = Collections.synchronizedSet(new HashSet()); /** Loader for codebase (which is a path, rather than a file) */ private CodeBaseClassLoader codeBaseLoader; @@ -1732,7 +1735,28 @@ */ protected SecurityDesc getCodeSourceSecurity(URL source) { - return jarLocationSecurityMap.get(source); + SecurityDesc sec=jarLocationSecurityMap.get(source); + if (sec == null && !alreadyTried.contains(source)) { + alreadyTried.add(source); + //try to load the jar which is requesting the permissions, but was NOT downloaded by standard way + if (JNLPRuntime.isDebug()) { + System.out.println("Application is trying to get permissions for " + source.toString() + ", which was not added by standard way. Trying to download and verify!"); + } + try { + JARDesc des = new JARDesc(source, null, null, false, false, false, false); + addNewJar(des); + sec = jarLocationSecurityMap.get(source); + } catch (Throwable t) { + if (JNLPRuntime.isDebug()) { + t.printStackTrace(); + } + sec = null; + } + } + if (sec == null){ + System.out.println(Translator.R("LNoSecInstance",source.toString())); + } + return sec; } /**