Hi,

On Mon, 2004-11-08 at 23:46, Steven Augart wrote:
> >  development: Failed in SPECjbb2000
> Another new problem, this time during class loading.  I'm CC'ing this 
> to the classpath list, since it probably points to a problem in 
> Classpath CVS head.
>
>          at java.util.jar.JarFile.verify(JarFile.java:669)
>          at java.util.jar.JarFile.readSignatures(JarFile.java:561)
>          at java.util.jar.JarFile.getEntry(JarFile.java:406)
>          at java.util.jar.JarFile.getJarEntry(JarFile.java:475)

I was just hunting this one down.
Attached is my first attempt.

It makes sure to not check the verified Map when the jar file is
explicitly opened with verify set to false. It also just compares the
value in the Map to Boolean.TRUE or Boolean.FALSE.

I am still thinking about synchronization issues.
It looks like we need to be more careful about synchronization when
manipulating/reading the verified Map since a JarFile can probably be
accessed from multiple threads at once.

Cheers,

Mark
Index: java/util/jar/JarFile.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/util/jar/JarFile.java,v
retrieving revision 1.12
diff -u -r1.12 JarFile.java
--- java/util/jar/JarFile.java	7 Nov 2004 22:04:57 -0000	1.12
+++ java/util/jar/JarFile.java	8 Nov 2004 23:10:50 -0000
@@ -363,7 +363,7 @@
       // signatures are valid. This means the certificates will not be
       // available if the entry hasn't been read yet.
       if (entryCerts != null && verified.containsKey(zip.getName())
-          && ((Boolean) verified.get(zip.getName())).booleanValue())
+          && verified.get(zip.getName()) == Boolean.TRUE)
         {
           Set certs = (Set) entryCerts.get(jar.getName());
           if (certs != null)
@@ -420,7 +420,7 @@
           debug("entryCerts=" + entryCerts + " verified " + name
                 + " ? " + verified.get(name));
         if (entryCerts != null && verified.containsKey(name)
-            && ((Boolean) verified.get(name)).booleanValue())
+            && verified.get(name) == Boolean.TRUE)
           {
             Set certs = (Set) entryCerts.get(name);
             if (certs != null)
@@ -455,7 +455,7 @@
       {
         if (DEBUG)
           debug("reading already verified entry " + entry);
-        if (!((Boolean) verified.get(entry.getName())).booleanValue())
+        if (verify && verified.get(entry.getName()) == Boolean.FALSE)
           throw new ZipException("digest for " + entry + " is invalid");
         return super.getInputStream(entry);
       }

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Classpath mailing list
[EMAIL PROTECTED]
http://lists.gnu.org/mailman/listinfo/classpath

Reply via email to