Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
8b813c2
8339280: jarsigner -verify performs cross-checking between CEN and LOC
haimaychao Feb 9, 2025
29b28a6
Revert changes to PushbackInputStream.java
haimaychao Feb 19, 2025
aa39c3d
Revert changes to JavaUtilZipFileAccess.java
haimaychao Feb 19, 2025
965fc70
Add TrackPushbackInputStream to extend PushbackInputStream
haimaychao Feb 19, 2025
e5e4ad5
Add TrackPushbackInputStream to extend PushbackInputStream
haimaychao Feb 19, 2025
8af1659
Revert changes to SharedSecrets.java
haimaychao Feb 19, 2025
ae33d07
Remove shared secret access JavaPBInputStreamAccess.java
haimaychao Feb 19, 2025
f67010e
Move JarsignerVerify.java to closed repo
haimaychao Feb 19, 2025
156c147
Revert changes to ZipEntry.java
haimaychao Feb 28, 2025
2fe64e0
Revert changes to ZipFile.java
haimaychao Feb 28, 2025
f0d2b35
Revert changes to ZipInputStream.java
haimaychao Feb 28, 2025
6299839
Revert changes to JavaUtilZipFileAccess.java
haimaychao Feb 28, 2025
84c8acb
Remove subclass TrackPushbackInputStream.java
haimaychao Feb 28, 2025
41dd7f3
Revert changes to PreserveRawManifestEntryAndDigest.java
haimaychao Feb 28, 2025
cc73b09
Revert changes to LowerCaseManifest.java
haimaychao Feb 28, 2025
130b3e2
Revert changes to Test.java
haimaychao Feb 28, 2025
50599b7
Revert changes to Main.java
haimaychao Feb 28, 2025
87817bc
Revert changes to Resources.java
haimaychao Feb 28, 2025
7fe6a73
Add cross checking in jarsigner instead of accessing ZIP internals
haimaychao Feb 28, 2025
d5fe503
Test on large entry
haimaychao Mar 3, 2025
eef4f11
Remove unneeded compressed large jar test
haimaychao Mar 13, 2025
28a9038
Update with review comment
haimaychao Mar 13, 2025
d7f8536
Revert changes
haimaychao Mar 14, 2025
daed840
Merge
haimaychao Mar 14, 2025
ad61b35
changes merged
haimaychao Mar 14, 2025
867ba60
Remove sorting for cenEntries
haimaychao Mar 14, 2025
31dcf68
Remove only if 1st entry is MANIFEST in cenEntries
haimaychao Mar 18, 2025
5d93e4d
Add testcase for entry name integrity check
haimaychao Mar 19, 2025
ef546f4
Update readEntry() and accumulate more warnings in compareManifest()
haimaychao Mar 19, 2025
219e91a
Update warnings to be more user-friendly (not with CEN/LOC)
haimaychao Mar 20, 2025
0d53bef
Convert new test to junit
haimaychao Mar 20, 2025
15544e2
Update test to include validating the un-modified jar
haimaychao Mar 20, 2025
56bd8b7
Update test with comment and formatting
haimaychao Mar 21, 2025
e70597d
Update test with more ZipEntry in the jar
haimaychao Mar 21, 2025
2ef9e5c
Updated with Sean's comments
haimaychao Mar 26, 2025
a963de7
Update with comments from Sean and Weijun
haimaychao Mar 26, 2025
286f8b1
Update warning messages
haimaychao Mar 27, 2025
18da4b0
Not split warning in rb.getString() accross multi-lines for Usages.java
haimaychao Mar 27, 2025
9736f59
Remove fast failing upon manifest issue and entry order check
haimaychao Mar 27, 2025
8ec7784
Add CEN/LOC summary warning to Informational Warnings
haimaychao Mar 27, 2025
da29c5e
Remove extra line break
haimaychao Mar 27, 2025
4c801be
Fix typo
haimaychao Mar 27, 2025
78093d4
Update with Weijun's comments
haimaychao Mar 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update readEntry() and accumulate more warnings in compareManifest()
  • Loading branch information
haimaychao committed Mar 19, 2025
commit ef546f4b778e8a1f43dbedc56a79bb53d169a1e7
Original file line number Diff line number Diff line change
Expand Up @@ -1182,12 +1182,12 @@ private void crossCheckEntries(String jarName) throws Exception {
}

private void readEntry(InputStream is) throws IOException {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be rewritten as is.transferTo(OutputStream.nullOutputStream()).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

byte[] buffer = new byte[8192];
while (is.read(buffer) != -1) {
}
is.transferTo(OutputStream.nullOutputStream());
}

private boolean compareManifest(Manifest cenManifest, Manifest locManifest) {
boolean validManifest = true;

if (cenManifest == null) {
crossChkWarnings.add(rb.getString("CEN.manifest.is.missing"));
return false;
Expand All @@ -1208,24 +1208,25 @@ private boolean compareManifest(Manifest cenManifest, Manifest locManifest) {
crossChkWarnings.add(String.format(
rb.getString("main.attribute.key.1.in.CEN.but.missing.in.LOC"),
key));
return false;
validManifest = false;
} else if (!cenValue.equals(locValue)) {
crossChkWarnings.add(String.format(
rb.getString("main.atrribute.key.1.mismatch.CEN.2.LOC.3"),
key, cenValue, locValue));
return false;
validManifest = false;
}
}

for (Object key : locMainAttrs.keySet()) {
if (!cenMainAttrs.containsKey(key)) {
System.out.println(String.format(
crossChkWarnings.add(String.format(
rb.getString("main.attribute.key.1.in.LOC.but.missing.in.CEN"),
key));
return false;
validManifest = false;
}
}
return true;

return validManifest;
}

private void compareSigners(JarEntry cenEntry, JarEntry locEntry) {
Expand Down