mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8229775: Incorrect warning when jar was signed with -sectionsonly
Reviewed-by: mullan
This commit is contained in:
parent
63baaf7a56
commit
b84ffae32f
2 changed files with 63 additions and 3 deletions
|
@ -685,6 +685,12 @@ public class Main {
|
|||
Vector<JarEntry> entriesVec = new Vector<>();
|
||||
byte[] buffer = new byte[8192];
|
||||
|
||||
String suffix1 = "-Digest-Manifest";
|
||||
String suffix2 = "-Digest-" + ManifestDigester.MF_MAIN_ATTRS;
|
||||
|
||||
int suffixLength1 = suffix1.length();
|
||||
int suffixLength2 = suffix2.length();
|
||||
|
||||
Enumeration<JarEntry> entries = jf.entries();
|
||||
while (entries.hasMoreElements()) {
|
||||
JarEntry je = entries.nextElement();
|
||||
|
@ -701,9 +707,14 @@ public class Main {
|
|||
boolean found = false;
|
||||
for (Object obj : sf.getMainAttributes().keySet()) {
|
||||
String key = obj.toString();
|
||||
if (key.endsWith("-Digest-Manifest")) {
|
||||
digestMap.put(alias,
|
||||
key.substring(0, key.length() - 16));
|
||||
if (key.endsWith(suffix1)) {
|
||||
digestMap.put(alias, key.substring(
|
||||
0, key.length() - suffixLength1));
|
||||
found = true;
|
||||
break;
|
||||
} else if (key.endsWith(suffix2)) {
|
||||
digestMap.put(alias, key.substring(
|
||||
0, key.length() - suffixLength2));
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue