852 Commits

Author SHA1 Message Date
Adam Hathcock
3c6c76fd4e Merge remote-tracking branch 'origin/rebuild/release-05-gzip-reader-archive' into rebuild/release-06-7z-header-bounds 2026-10-09 15:01:17 +01:00
Adam Hathcock
67a22cca97 Fix net48 test build: use plain using for AsyncOnlyStream in gzip reader/archive tests
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 14:59:45 +01:00
Adam Hathcock
6b54523cc6 Merge remote-tracking branch 'origin/release' into rebuild/release-06-7z-header-bounds 2026-10-09 14:51:41 +01:00
Adam Hathcock
f07d5e5d75 Merge remote-tracking branch 'origin/release' into rebuild/release-05-gzip-reader-archive 2026-10-09 14:51:14 +01:00
Adam Hathcock
830c816269 Fix net48 test build: use plain using for types without DisposeAsync
AsyncOnlyStream and EntryStream have no DisposeAsync on net48, so
await using fails to compile for that target.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 14:41:59 +01:00
Adam Hathcock
2f2730fd01 Validate 7z next header bounds before allocation 2026-10-09 11:56:36 +01:00
Vadim Syrov
5214c349d1 Fix gzip XLEN overflow in reader and archive APIs 2026-10-09 11:56:36 +01:00
Vadim Syrov
b047d6860a Fix gzip FEXTRA XLEN overflow 2026-10-09 11:56:36 +01:00
Adam Hathcock
bc58792b86 Fix encrypted RAR header state when rescanning archives
Reset scan-specific encryption state in sync and async header readers while retaining the KDF cache. Add RAR4/RAR5 rescan and solid encrypted extraction regression coverage.

Fixes #1422
2026-10-09 11:56:35 +01:00
Iain
23e667ed24 Fix split zip parts not found when the .ZIP is uppercase 2026-10-09 11:56:23 +01:00
Adam Hathcock
2071e9036a Merge pull request #1426 from adamhathcock/fix/rar5-file-data-key-cache
Reuse RAR5 derived keys across encrypted file entries
2026-10-05 11:10:18 +01:00
Adam Hathcock
2cd70d019f Reuse RAR5 derived keys across encrypted file entries 2026-10-05 11:05:33 +01:00
Adam Hathcock
ce081cda1c fix build 2026-10-05 10:59:57 +01:00
Adam Hathcock
915183320c added some review fixes 2026-10-05 10:48:34 +01:00
Adam Hathcock
4f8c69f2c3 don't use RarReader directory 2026-10-02 15:23:16 +01:00
Adam Hathcock
d3edc48654 Merge remote-tracking branch 'origin/release' into fix/rar5-encrypted-comments 2026-10-02 13:53:38 +01:00
Adam Hathcock
545dfb61be Update .NET SDK and SourceLink to fix NuGet auditing 2026-10-02 13:40:23 +01:00
Adam Hathcock
b67a8a4ead Fix encrypted RAR5 archive comments 2026-10-02 13:33:55 +01:00
Adam Hathcock
c90997e12e Fix repeated RAR5 encrypted header key derivation 2026-10-02 09:39:38 +01:00
Adam Hathcock
c083c6efd8 fmt 2026-08-05 15:59:16 +01:00
Adam Hathcock
a25ef129a4 Fix sym link tests 2026-08-05 15:44:27 +01:00
Adam Hathcock
513b6bec45 fixes SharpCompress TAR extraction overwrites files outside the extraction root when a SymbolicLinkHandler enables symlink chaining 2026-08-05 15:44:27 +01:00
Adam Hathcock
82c44cb5a5 remove async dispose 2026-07-31 14:52:58 +01:00
Adam Hathcock
a8f6f18843 Fix SeekableSharpCompressStream.StopRecording() to rewind to recorded position
When SeekableSharpCompressStream.StopRecording() was called (e.g. after the tar
probe in GZipFactory.TryOpenReader), it cleared _recordedPosition without seeking
back to it. This left the underlying FileStream at the advanced position reached
during the probe, so the subsequent GZipReader would start reading from the
wrong offset, producing Key=null and 0 extracted bytes.

Fix: seek back to _recordedPosition before clearing it, matching the behavior of
the non-seekable SharpCompressStream.StopRecording() which rewinds _logicalPosition.

Also enhance the existing GZip_ReaderFactory_FlatGZip test to actually verify the
extracted content (not just MoveToNextEntry returns true), and add an async variant.

Closes #1391
2026-07-31 14:21:24 +01:00
Adam Hathcock
fe75f28ac9 DataDescriptor should always be non-seekable 2026-07-25 17:08:50 +01:00
Adam Hathcock
ba221b27af Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-07-24 09:34:18 +01:00
copilot-swe-agent[bot]
3e61a72248 test: broaden transformed stream reader coverage 2026-07-24 07:35:07 +00:00
copilot-swe-agent[bot]
3375aaa90c fix: preserve transformed streams in reader detection 2026-07-24 07:18:02 +00:00
Adam Hathcock
bb7be935a3 Merge pull request #1372 from adamhathcock/adam/pr-1369
Fixes ZipWriter to be fully forward only
2026-07-23 10:23:12 +01:00
Adam Hathcock
152a66f802 add more tests 2026-07-23 10:17:28 +01:00
Adam Hathcock
e3b7a560ba Fix legacy build issue 2026-07-23 10:04:06 +01:00
Adam Hathcock
02f1a1616a Fixes ZipWriter to be fully forward only 2026-07-23 09:28:04 +01:00
copilot-swe-agent[bot]
b86a871e22 Fix GZipFactory flat gzip probe disposal regression 2026-07-23 08:02:01 +00:00
Adam Hathcock
073d99153b Merge pull request #1360 from adamhathcock/adam/remove-compressed-tar-archive
Remove compressed tar archive
2026-07-12 11:55:04 +01:00
Adam Hathcock
581a6dc945 Further advice from Sol 2026-07-12 11:35:46 +01:00
Adam Hathcock
fda3d186c5 more tests and a removal of a test 2026-07-12 11:09:49 +01:00
Pat Hartl
c59aa78928 Zip: fix Zip64 streaming reader corrupting entry size/CRC and failing on non-seekable streams
The Zip64 branch of the streaming header reader assumed a data descriptor always follows a >=4GB entry. When the entry instead has back-patched sizes (no descriptor), the following header was parsed as descriptor fields, overwriting the entry's correct size/CRC with central-directory 0xFFFFFFFF sentinels and, on non-seekable async streams, leaving the reader misaligned so the next entry threw.

Now it detects a header signature after the entry data and leaves the already-correct metadata untouched, parsing that header normally. The fix has been applied to both the sync and async readers.
2026-06-29 21:35:55 -05:00
Adam Hathcock
b8a7cc18d9 intermediate commit 2026-06-24 16:27:57 +01:00
Adam Hathcock
760f7685f8 First pass of removing Compressed Tar Archive support. Compressed Tars should be done with TarReader only 2026-06-23 15:42:04 +01:00
Fidel
de8ee30b17 BZip2: add opt-in tolerateTruncatedStream to decode a footerless/partial stream
Add a `tolerateTruncatedStream` option (default false) to `BZip2Stream.Create`/`CreateAsync`,
threaded through to `CBZip2InputStream`. When enabled, the decoder accepts a stream that has no
trailing footer - e.g. a truncated stream, or a sub-range of blocks extracted for random access:

- An end-of-input reached while reading a block/footer header (a true block boundary, tracked by
  `expectingBlockStart`) is treated as a normal end of stream instead of throwing
  `ArchiveOperationException("BZip2 compressed file ends unexpectedly")`. EOF in the middle of a
  block, the block CRC, or the Huffman tables still throws.
- The whole-stream combined CRC in the footer is not verified, since a partial decode's running
  combined CRC won't match the stored whole-stream value. Per-block CRCs are still enforced.

Default behaviour is unchanged (the flag defaults to false) and the change is applied symmetrically
to the sync and async read paths.

Tests (BZip2StreamTests):
- a footerless header-only stream decodes to empty with the flag and throws without it;
- a real block followed by end-of-input at the next block boundary decodes with the flag and throws
  without it;
- a corrupted whole-stream combined CRC is tolerated with the flag and fatal without it;
- a complete, well-formed stream still round-trips with the flag set.
All existing BZip2 tests continue to pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 13:08:02 +10:00
Adam Hathcock
49d00034e4 update tests 2026-06-19 11:21:39 +01:00
Adam Hathcock
727d2a79f9 updates from review 2026-06-18 17:06:16 +01:00
Adam Hathcock
e8ee054757 rest of the formats 2026-06-15 17:02:31 +01:00
Adam Hathcock
808524d917 BZip2, GZip and XZ done 2026-06-15 09:59:48 +01:00
Adam Hathcock
e9e05520d6 7Zip and Rar 2026-06-15 09:29:50 +01:00
Adam Hathcock
2866bfbd54 First pass with zip 2026-06-15 09:17:05 +01:00
Adam Hathcock
78a2218982 Handle lzma end marker correctly 2026-06-13 15:09:13 +01:00
Adam Hathcock
2d041e5c76 Fixed XZ block CRC64 computation and added notes on XZ format specifics 2026-06-13 14:31:36 +01:00
Adam Hathcock
160ba0938a review fixes 2026-06-13 10:00:39 +01:00
Adam Hathcock
7814013995 Merge remote-tracking branch 'origin/master' into adam/xz-crc-check 2026-06-13 09:40:39 +01:00