jdk/src/share/classes/java/util/jar/JarFile.java
changeset 9365 469cd39a25de
parent 9248 44d129a2adfa
child 11274 7e7196757acd
--- a/jdk/src/share/classes/java/util/jar/JarFile.java	Wed Jul 05 17:42:19 2017 +0200
+++ b/jdk/src/share/classes/java/util/jar/JarFile.java	Sun May 01 09:14:36 2011 -0700
@@ -37,7 +37,6 @@
 import sun.security.action.GetPropertyAction;
 import sun.security.util.ManifestEntryVerifier;
 import sun.misc.SharedSecrets;
-import sun.security.util.SignatureFileVerifier;
 
 /**
  * The <code>JarFile</code> class is used to read the contents of a jar file
@@ -179,7 +178,7 @@
                     byte[] b = getBytes(manEntry);
                     man = new Manifest(new ByteArrayInputStream(b));
                     if (!jvInitialized) {
-                        jv = new JarVerifier(b, man);
+                        jv = new JarVerifier(b);
                     }
                 } else {
                     man = new Manifest(super.getInputStream(manEntry));
@@ -298,7 +297,10 @@
             if (names != null) {
                 for (int i = 0; i < names.length; i++) {
                     String name = names[i].toUpperCase(Locale.ENGLISH);
-                    if (SignatureFileVerifier.isBlockOrSF(name)) {
+                    if (name.endsWith(".DSA") ||
+                        name.endsWith(".RSA") ||
+                        name.endsWith(".EC") ||
+                        name.endsWith(".SF")) {
                         // Assume since we found a signature-related file
                         // that the jar is signed and that we therefore
                         // need a JarVerifier and Manifest
@@ -327,17 +329,17 @@
             if (names != null) {
                 for (int i = 0; i < names.length; i++) {
                     JarEntry e = getJarEntry(names[i]);
-                    if (!e.isDirectory() &&
-                            SignatureFileVerifier.isBlock(names[i])) {
+                    if (!e.isDirectory()) {
                         if (mev == null) {
                             mev = new ManifestEntryVerifier
                                 (getManifestFromReference());
                         }
-                        String key = names[i].substring(
-                                0, names[i].lastIndexOf("."));
-                        jv.verifyBlock(names[i],
-                                getBytes(e),
-                                super.getInputStream(getJarEntry(key + ".SF")));
+                        byte[] b = getBytes(e);
+                        if (b != null && b.length > 0) {
+                            jv.beginEntry(e, mev);
+                            jv.update(b.length, b, 0, b.length, mev);
+                            jv.update(-1, null, 0, 0, mev);
+                        }
                     }
                 }
             }