8302819: Remove JAR Index

Reviewed-by: mchung, alanb, lancea, jpai
This commit is contained in:
Eirik Bjorsnos 2023-04-10 11:23:21 +00:00 committed by Lance Andersen
parent 0243da2e4a
commit 0d45a524b3
24 changed files with 45 additions and 1394 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -207,12 +207,18 @@ public class JarFile extends ZipFile {
*/
public static final String MANIFEST_NAME = META_INF + "MANIFEST.MF";
/**
* The 'JAR index' feature has been removed, but JarInputStream and
* JarVerifier's verification of signed jars still need to be
* able to skip this entry.
*/
static final String INDEX_NAME = "META-INF/INDEX.LIST";
/**
* Returns the version that represents the unversioned configuration of a
* multi-release jar file.
*
* @return the version that represents the unversioned configuration
*
* @since 9
*/
public static Runtime.Version baseVersion() {

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -28,7 +28,6 @@ package java.util.jar;
import java.util.zip.*;
import java.io.*;
import sun.security.util.ManifestEntryVerifier;
import jdk.internal.util.jar.JarIndex;
/**
* The {@code JarInputStream} class, which extends {@link ZipInputStream},
@ -185,7 +184,7 @@ public class JarInputStream extends ZipInputStream {
}
} else {
e = first;
if (first.getName().equalsIgnoreCase(JarIndex.INDEX_NAME))
if (first.getName().equalsIgnoreCase(JarFile.INDEX_NAME))
tryManifest = true;
first = null;
}

View file

@ -33,7 +33,6 @@ import java.security.SignatureException;
import java.security.cert.Certificate;
import java.security.cert.CertificateException;
import jdk.internal.util.jar.JarIndex;
import sun.security.util.ManifestDigester;
import sun.security.util.ManifestEntryVerifier;
import sun.security.util.SignatureFileVerifier;
@ -146,7 +145,7 @@ class JarVerifier {
}
String uname = name.toUpperCase(Locale.ENGLISH);
if (uname.equals(JarFile.MANIFEST_NAME) ||
uname.equals(JarIndex.INDEX_NAME)) {
uname.equals(JarFile.INDEX_NAME)) {
return;
}