diff options
author | Omair Majid <[email protected]> | 2011-02-01 21:07:03 -0500 |
---|---|---|
committer | Omair Majid <[email protected]> | 2011-02-01 21:07:03 -0500 |
commit | 17633c352c8122f43a3534f7cc9cfb3244745642 (patch) | |
tree | c52f93e45ba7b78c7651769ea8fb400c565f0250 /netx/net/sourceforge/jnlp | |
parent | 1a96cc8537ee8a6e9aff7465568ba76b949b1535 (diff) |
Verify nested jars just like main jars
Fix an exception that occurs when More Information is clicked in the
Certificate warning dialog when dealing with signed nested jars.
2011-02-01 Omair Majid <[email protected]>
* netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
(activateJars): Add the nested jar to ResourceTracker. Use
JarSigner.verifyJars instead of JarSigner.verifyJar.
* netx/net/sourceforge/jnlp/tools/JarSigner.java
(verifyJar): Make private to indicate nothing should be using this
directly.
Diffstat (limited to 'netx/net/sourceforge/jnlp')
-rw-r--r-- | netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java | 6 | ||||
-rw-r--r-- | netx/net/sourceforge/jnlp/tools/JarSigner.java | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java index acadde0..30f1af2 100644 --- a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java +++ b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java @@ -693,7 +693,11 @@ public class JNLPClassLoader extends URLClassLoader { } JarSigner signer = new JarSigner(); - signer.verifyJar(extractedJarLocation); + List<JARDesc> jars = new ArrayList<JARDesc>(); + JARDesc jarDesc = new JARDesc(new File(extractedJarLocation).toURL(), null, null, false, false, false, false); + jars.add(jarDesc); + tracker.addResource(new File(extractedJarLocation).toURL(), null, null); + signer.verifyJars(jars, tracker); if (signer.anyJarsSigned() && !signer.getAlreadyTrustPublisher()) { checkTrustWithUser(signer); diff --git a/netx/net/sourceforge/jnlp/tools/JarSigner.java b/netx/net/sourceforge/jnlp/tools/JarSigner.java index 4e246f7..14ca069 100644 --- a/netx/net/sourceforge/jnlp/tools/JarSigner.java +++ b/netx/net/sourceforge/jnlp/tools/JarSigner.java @@ -232,7 +232,7 @@ public class JarSigner implements CertVerifier { } - public verifyResult verifyJar(String jarName) throws Exception { + private verifyResult verifyJar(String jarName) throws Exception { boolean anySigned = false; boolean hasUnsignedEntry = false; JarFile jarFile = null; |