Repository navigation
fix(sdk): write the compressed size into the zip data descriptor (DSPX-4591) - #1086
Closed
dmihalcik-virtru wants to merge 1 commit into
Closed
dmihalcik-virtru wants to merge 1 commit into
dmihalcik-virtru wants to merge 1 commit into
Conversation
…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>
|
Warning Review limit reachedYou'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. View limit details
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. Comment |
This was referenced Oct 14, 2026
|
Member
Author
|
Re-open if we ever decide to compress the manifest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



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.writeDataDescriptorwroteuncompressedSizeinto both size slots. That only looked right because we alwaysSTORE.
I kept the non-zip64 branch and fixed it rather than deleting it.
ZipWriter.zip64isa public mutable field, and the existing unit tests exercise
zip64 = falsefor allfour writer methods. Deleting one of the four branches would leave the writer unable to
emit a coherent non-zip64 archive.
writeDataDescriptornow takes an optionalcompressedSize, defaulting touncompressedSize, 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.tspass distinct compressed anduncompressed sizes, one zip64 and one not, and check that each value lands in its own
slot.
Checks run
cd lib && npx mocha(full mocha suite) passes, as does prettier and eslint on the changed files.