Commit graph

398 commits

Author SHA1 Message Date
Chris Hennick
0bd2fe11d7
fix: Parse the extra field and reject it if invalid 2024-06-13 17:48:54 -07:00
Chris Hennick
a06fbaca08
style: Fix unused import 2024-06-13 13:55:38 -07:00
Chris Hennick
77e718864d
fix: Incorrect behavior following a rare combination of merge_archive, abort_file and deep_copy_file. As well, we now return an error when a file is being copied to itself. 2024-06-13 13:49:27 -07:00
Chris Hennick
5aadcb758a
style: Remove unneeded 'static 2024-06-12 21:50:25 -07:00
Chris Hennick
6366d45949
fix: Implement Debug for ZipWriter even when it's not implemented for the inner writer's type 2024-06-11 20:12:13 -07:00
Chris Hennick
cf19487a55
chore: Fix: may still get an incorrect size if opening an invalid file for append 2024-06-08 15:23:27 -07:00
Chris Hennick
894e0ad44c
fix: Fix an issue where the central directory could be incorrectly detected 2024-06-08 15:10:08 -07:00
Chris Hennick
f3bb677511
fix: finish_into_readable() would corrupt the archive if the central directory had moved 2024-06-08 14:27:53 -07:00
Chris Hennick
df9c71700e
ci(fuzz): Fine-tune some Debug implementations 2024-06-08 13:51:31 -07:00
Chris Hennick
e052842d78
style: cargo fmt --all 2024-06-04 08:58:17 -07:00
Chris Hennick
b4970dd80f
test: Delete a unit test that's no longer needed 2024-06-04 08:55:33 -07:00
Chris Hennick
362a1123b5
ci(fuzz): Limit Zopfli buffer size to fix OOMEs 2024-06-04 08:38:05 -07:00
Chris Hennick
b7bec1c2dd
fix: Some date/time filters were previously unreliable (i.e. later-pass filters had no earliest-pass or latest-fail, and vice-versa) 2024-06-03 22:35:40 -07:00
Chris Hennick
cb50ca1213
test: Bug fix? Explicitly type int that may become as large as 3 << 29 2024-06-03 21:12:54 -07:00
Chris Hennick
c06f49b153
ci(fuzz): Fix: T::arbitrary returns Result 2024-06-03 20:43:49 -07:00
Chris Hennick
c0cc03c0e7
style: cargo fmt --all 2024-06-03 20:25:36 -07:00
Chris Hennick
ad218a6c9c
ci(fuzz): Allow zopfli_buffer_size to be 3 * power of 2 2024-06-03 20:23:46 -07:00
Chris Hennick
eacc320fe0
chore: Add check for wrong-length blocks, and incorporate fixed-size requirement into the trait name 2024-06-02 21:48:21 -07:00
Chris Hennick
28fb992532
chore: Refactor alignment field write logic 2024-06-02 17:37:45 -07:00
Chris Hennick
2a131e67a9
fix: Use deflate-flate2 flag to guard import 2024-06-02 17:29:49 -07:00
Chris Hennick
79fc5a9cdd
chore: Fix a build error 2024-06-02 17:06:10 -07:00
Chris Hennick
8e92cc4d81
chore: Fix a build error 2024-06-02 17:03:32 -07:00
Chris Hennick
888e5fac16
fix: Switch padding field ID to one documented in APPNOTE 2024-06-02 16:09:19 -07:00
Alex Franchuk
a8875b0226
feat: Allow the archive offset behavior of the reader to be configured.
Aside from supporting the current behavior which allows archives to be
preceded by arbitrary data (added in fc749a09), this also allows
detection of the offset to use by checking whether a central directory
header is at the expected location. This is configurable because if the
behavior were based only on detection, there could be false positives if
archive data happened to contain a central directory header at the right
spot.
2024-05-29 13:59:20 -04:00
Chris Hennick
bf7c8d21fb
style: cargo fmt --all 2024-05-27 17:20:46 -07:00
Chris Hennick
0c7b0080f3
chore: Bug fixes for debug implementation 2024-05-27 17:18:31 -07:00
Chris Hennick
8d81cbc2c3
chore: Bug fixes for debug implementation 2024-05-27 17:11:24 -07:00
Chris Hennick
48b1adb64b
fix: Derive Debug for ZipWriter 2024-05-27 16:58:12 -07:00
Chris Hennick
fdb01c3dd2
style: cargo fmt --all 2024-05-25 15:10:31 -07:00
Chris Hennick
eb949ebdef
chore: Update unit tests 2024-05-25 15:05:02 -07:00
Chris Hennick
15f8bac454
chore: Remove unused import 2024-05-25 14:51:18 -07:00
Chris Hennick
edbb7343f5
refactor: use a MIN_VERSION constant 2024-05-25 14:29:36 -07:00
Chris Hennick
40f20d8a6b
fix: lower default version to 4.5 and use the version-needed-to-extract where feasible. 2024-05-25 14:29:35 -07:00
Chris Hennick
92012b9795
chore: Tweaks to make version_needed and version_made_by work with recently-merged changes 2024-05-24 21:55:18 -07:00
Chris Hennick
cda4712153
fix: version-needed-to-extract was incorrect in central header, and version-made-by could be lower than that (#100) 2024-05-24 21:47:06 -07:00
Chris Hennick
a28b16e69c
Apply suggestions from code review
Fix errors

Signed-off-by: Chris Hennick <4961925+Pr0methean@users.noreply.github.com>
2024-05-24 15:27:28 -07:00
Chris Hennick
df70f6a320
Fix unmatched bracket due to bad merge
Signed-off-by: Chris Hennick <4961925+Pr0methean@users.noreply.github.com>
2024-05-24 14:57:06 -07:00
Chris Hennick
6b19c877e2
Merge branch 'master' into bulk-parsing
Signed-off-by: Chris Hennick <4961925+Pr0methean@users.noreply.github.com>
2024-05-24 14:50:21 -07:00
Chris Hennick
294564c1a8
style: cargo fmt --all 2024-05-24 14:26:12 -07:00
Chris Hennick
0636bd7411
fix: version-needed-to-extract was incorrect in central header, and version-made-by could be lower than that (#100) 2024-05-24 14:24:55 -07:00
Danny McClanahan
80ca254569
fix doc comments 2024-05-24 08:15:16 -04:00
Danny McClanahan
a769e9410e
Revert "interpose ZipRawValues into ZipFileData"
This reverts commit d8d4dee5cec372878259380fa347c0ffc6cca044.
2024-05-24 08:00:04 -04:00
Danny McClanahan
4a784b5636
interpose ZipRawValues into ZipFileData 2024-05-24 07:58:05 -04:00
Danny McClanahan
0b31d9846a
review comments 2 2024-05-24 07:54:41 -04:00
Danny McClanahan
21d07e192c
add ExtraFieldMagic and Zip64ExtraFieldBlock 2024-05-24 07:54:39 -04:00
Danny McClanahan
cf2d980612
expose pub(crate) methods to convert compression methods 2024-05-24 07:53:15 -04:00
Danny McClanahan
ad1d51d099
write file comment to central directory header 2024-05-24 07:52:30 -04:00
Danny McClanahan
ea308499af
bulk parsing and bulk writing
- use blocks for reading individual file headers
- remove unnecessary option wrapping for stream entries
- create Block trait
- add coerce method to reduce some boilerplate
- add serialize method to reduce more boilerplate
- use to_le! and from_le!
- add test case
- add some docs
- rename a few structs to clarify zip32-only
2024-05-24 07:52:25 -04:00
Chris Hennick
da8be86761
style: cargo fmt --all 2024-05-23 15:53:37 -07:00
Chris Hennick
7d61377503
refactor: Change type of last_modified_time to Option<DateTime> 2024-05-23 14:15:38 -07:00