RFR: 8321396: Retire test/jdk/java/util/zip/NoExtensionSignature.java [v2]

Eirik Bjørsnøs eirbjo at openjdk.org
Wed Jan 24 10:28:46 UTC 2024


> Please review this PR which suggests we retire the ZIP test `NoExtensionSignature` along with its `test.jar` test vector. 
> 
> The concern of a missing data descriptor signature is covered by the recently updated  `DataDescriptorSignatureMissing` test, see #12959. That test is more complete, includes more documentation and uses a programmatically generated test vector.
> 
> Careful analysis of the deleted `test.jar` test vector revealed that it contains a local header with non-zero `compressed size` and `uncompressed size` fields for a streaming-mode entry. `APPNOTE.TXT` mandates that when bit 3 of the general purpose bit flag is set, then these fields and the `crc` field should all be set to zero. 
> 
> By injecting assertions into `ZipInputStream.readLOC` I was able to determine that `NoExtensionSignature` is the only test currently parsing a ZIP file with such non-zero fields in streaming mode. 
> 
> Because of this, and out of caution, this PR introduces a new test `DataDescriptorIgnoreCrcAndSizeFields` which  explicitly verifies that `ZipInputStream` does not read any non-zero `crc`, `compressed size` or `uncompressed size` field values from a local header when in streaming mode. `ZipInputStream` should ignore these values and it would be good to have a test which asserts that this invariant holds even when the fields are non-zero.

Eirik Bjørsnøs has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:

 - Merge branch 'master' into retire-no-extension-signature
 - Rename 'nameAndContent' parameter to 'expected'
 - Retire the test NoExtensionSignature in favor of DataDescriptorSignatureMissing. Introduce the new test DataDescriptorIgnoreCrcAndSizeFields covering unrelated aspects implicitly tested by NoExtensionSignature.

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/16975/files
  - new: https://git.openjdk.org/jdk/pull/16975/files/854060a4..bd9e8738

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=16975&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=16975&range=00-01

  Stats: 155679 lines in 2876 files changed: 86094 ins; 58372 del; 11213 mod
  Patch: https://git.openjdk.org/jdk/pull/16975.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/16975/head:pull/16975

PR: https://git.openjdk.org/jdk/pull/16975


More information about the core-libs-dev mailing list