Skip to content

fix(sdk): write the compressed size into the zip data descriptor (DSPX-4591) - #1086

Closed
dmihalcik-virtru wants to merge 1 commit into
mainfrom
DSPX-4591-zip-data-descriptor
Closed

dmihalcik-virtru wants to merge 1 commit into
mainfrom
DSPX-4591-zip-data-descriptor

Conversation

@dmihalcik-virtru

@dmihalcik-virtru dmihalcik-virtru commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

Jira: https://virtru.atlassian.net/browse/DSPX-4591

Finding 3 of the DSPX-4591 zip conformance audit, split out of #1017.

What / why

The data descriptor record is signature, crc-32, compressed size, uncompressed size
(APPNOTE 4.3.9). The non-zip64 branch of ZipWriter.writeDataDescriptor wrote
uncompressedSize into both size slots. That only looked right because we always
STORE.

I kept the non-zip64 branch and fixed it rather than deleting it. ZipWriter.zip64 is
a public mutable field, and the existing unit tests exercise zip64 = false for all
four writer methods. Deleting one of the four branches would leave the writer unable to
emit a coherent non-zip64 archive.

writeDataDescriptor now takes an optional compressedSize, defaulting to
uncompressedSize, and writes it into the compressed size slot in both branches.
Output for every existing call site is byte-identical, and the existing characteristic
tests are unchanged.

Tests

Two new tests in lib/tests/mocha/unit/zip.spec.ts pass distinct compressed and
uncompressed sizes, one zip64 and one not, and check that each value lands in its own
slot.

Checks run

…X-4591)

The non-zip64 data descriptor wrote uncompressedSize into both size
slots. writeDataDescriptor now takes an optional compressedSize
(defaulting to uncompressedSize, since we only STORE) and writes it into
the compressed size slot in both branches. Output for every existing call
site is byte-identical.

Signed-off-by: Dave Mihalcik <dmihalcik@virtru.com>
@dmihalcik-virtru
dmihalcik-virtru requested a review from a team as a code owner October 14, 2026 20:43
@coderabbitai

coderabbitai Bot commented Oct 14, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d6556a2a-094e-4c22-9b11-7a9bd3e976a7
📥 Commits

Reviewing files that changed from the base of the PR and between ebc317a and 8585eeb.

📒 Files selected for processing: 2
  • lib/tdf3/src/utils/zip-writer.ts
  • lib/tests/mocha/unit/zip.spec.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sonarqubecloud

Copy link
Copy Markdown

@dmihalcik-virtru

Copy link
Copy Markdown
Member Author

Re-open if we ever decide to compress the manifest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant