SharpZipLib

#ziplib is a Zip, GZip, Tar and BZip2 library written entirely in C# for the .NET platform.

MIT License

Stars
3.6K
Committers
60

Bot releases are visible (Hide)

SharpZipLib - v1.4.2 Latest Release

Published by piksel over 1 year ago

New patch release that further fixes issues with the changes in v1.4.0.

Fixes:

Other changes (not related to library code):

SharpZipLib - v1.4.1

Published by piksel almost 2 years ago

New patch release that mainly fixes issues with the changes in v1.4.0.

ZIP String Encoding:

Further iteration on the StringCodec API, since the released version was confusing to use and in some cases could not be used without causing deprecation warnings.

TAR:

Two issues that could cause deadlocks was found in v1.4.0, one due to a typo in the async implementation and one due to a buffer not being cleared.

Async:

General async speed improvement, since we now correctly opt out of requiring to continue in the same context (ConfigureAwait(false)).

Other changes (not related to library code):

SharpZipLib - v1.4.0

Published by piksel about 2 years ago

New minor release focusing on async and supporting newer frameworks.

Note that this version drops support for the EOL .NET 4.5 Framework, but adding explicit support for .NET 6.

Features:

Fixes:

Other changes (not related to library code):

SharpZipLib - v1.3.3

Published by piksel about 3 years ago

Another minor release, containing security fixes and smaller bugfixes.

Fixes:

Smaller changes:

  • 🔨 [#604] Move the Password property from DeflaterOutputStream into ZipOutputStream by Richard Webb
  • 🔨 [#625] Make BZip2Constants static instead of sealed by Richard Webb
  • 🔨 [#626] make a couple of private functions static by Richard Webb

Other changes (not related to library code):

SharpZipLib - v1.3.2

Published by piksel over 3 years ago

Another minor release, containing security fixes and smaller bugfixes.
Additionally, this version will have an additional target framework, .NET Standard 2.1, which will see some speed improvements when
used in newer versions of .NET (Core), mainly in Bzip2.

Features

Smaller fixes and optimizations

Other changes (not related to library code)

SharpZipLib - v1.3.1

Published by piksel almost 4 years ago

Minor release, mainly to address the incorrect file version of v1.3.0, but also contains some security fixes and performance improvements.

Highlights

  • Correct FileVersion and AssemblyVersion
  • Security fixes for ZipFile and Zip*Streams
  • Improved CRC32 performance
  • BZip2 compression support for Zip files

Features

Fixes

Other changes (not related to library code)

SharpZipLib - v1.3.0

Published by piksel about 4 years ago

Highlights

  • AES encryption fixes and support in FastZip
  • File name encoding support for Tar
  • Improved Unix timestamp support
  • Better handling of entry file names
  • Fix errors with entries using Stored compression method

Changes

  • TarArchive.ExtractContents() now needs another parameter set to true to allow the extraction to traverse outside of the target directory.
  • TarArchive constructors now includes an Encoding parameter. Omitting it will discard any non-ASCII bytes in file names.

Fixes

  • [#503] Consider AES overhead when testing encrypted folder entries by Richard Webb
  • [#452] Ensure crypto streams are disposed in ZipFile.GetOutputStream by Richard Webb
  • [#333] Handle unsupported compression methods in ZipInputStream better by Richard Webb
  • [#402] Only convert entry.Name once when accessing updateIndex by Vladyslav Taranov
  • [#353] Fix ZipFile.TestLocalHeader CompressionMethod resolving for AES entries by Richard Webb
  • [#460] Account for AES overhead in compressed entry size by Richard Webb
  • [#422] Change ZipOutputStream.PutNextEntry to explicity validate the requested compression method by Richard Webb
  • [#467] Allow seeking a PartialInputStream to the very end by Víctor M. González
  • [#440] Use CompressionMethodForHeader for header entries by Richard Webb
  • [#420] Throw NotSupportedException in ZipFile.Add when trying to add AES entry by Richard Webb
  • [#421] Have ZipFile.Add validate compression compability internally by Richard Webb
  • [#387] Better handle baseStreams closing themselves unexpectedly by Richard Webb
  • [#408] When searching for the Zip64 end of central directory locator, pay attention to its fixed size by Richard Webb
  • [#406] Skip forced Deflate flush when using Stored compression by nils måsén
  • [#362] Don't call CleanName from the ZipEntry constructor by Richard Webb
  • [#465] Use correct count in ZipAESStream.ReadBufferedData by Víctor M. González
  • [#390] Ensure GZipOutputStream headers are written before flush by Richard Webb
  • [#498] Use string.Trim to trim strings by Richard Webb
  • [#432] Throw ArgumentNullException in BZip2 by Richard Webb
  • [#519] Restrict path traversal on TarArchive extraction by nils måsén

Features

  • [#201] Raise ProcessDirectory event for FastZip extract by Stevie-O
  • [#380] Add support for AES encryption in FastZip.CreateZip by Richard Webb
  • [#497] Transform new entry names using an INameTranform in ZipOutputStream by Richard Webb
  • [#482] Add variants of FastZip.CreateZip taking IScanFilter instead of strings by Richard Webb
  • [#455] Add FastZip.CreateZip with a leaveOpen parameter by Richard Webb
  • [#433] Restore directory timestamps when extracting with FastZip by Richard Webb
  • [#472] Allow ZipFile to accept empty strings as passwords when decrypting AES entries by Richard Webb
  • [#364] Add nameEncoding parameter to Tar entries by Yusuke Ito
  • [#463] Improve support for Unix timestamps in ZIP archives by Bastian Eicher

Other changes (not related to library code)

  • [#346] Add a Security Policy by nils måsén
  • [#451] Minimize and update sample app package dependencies by Richard Webb
  • [#505] Expect ZipEntry clean name test to be positive by nils måsén
  • [#504] Fix warning about missing doc comment in FastZip.CreateZip by Richard Webb
  • [#374] Update Docs generation by nils måsén
  • [#431] Remove the link to the sharpdevelop forum from readme.md by Richard Webb
  • [#425] Update Microsoft.SourceLink.GitHub to the 1.0.0 release version by Richard Webb
  • [#483] Suppress CA1707 warnings from LzwConstants by Richard Webb
  • [#458] Dispose of entry streams returned by ZipFile.GetInputStream by Richard Webb
  • [#488] Add [MemoryDiagnoser] to the zip input/output stream benchmark classes by Richard Webb
  • [#489] Remove duplicate ICSharpCode.SharpZipLib.snk by Richard Webb
  • [#494] Use the Range to test different compression levels in InflaterDeflaterTestSuite by Richard Webb
  • [#502] Fix tests and ZipEntry DateTime Kind by nils måsén
  • [#476] Remove duplicated words in comments by Richard Webb
  • [#477] Fix spelling errors in comments by Richard Webb
  • [#479] Streamline and update VB sample projects by Richard Webb
  • [#445] Make InvalidHeaderException serializable by Richard Webb
  • [#450] Fix CA1200 code analyzer warnings by Richard Webb
  • [#435] Add unit test for ZipFile.Add(string fileName, string entryName) by Richard Webb
  • [#448] Fix unit test assert argument order by Richard Webb
  • [#461] Fix Exception doc comments by Richard Webb
  • [#453] Fix the 7-zip interop tests in the .Net 4.6 test build by Richard Webb
  • [#466] Improve the ZipFileStoreAesPartialRead test to test multiple block sizes by Richard Webb
  • [#468] Add test for adding empty folders to archives using FastZip by Richard Webb
  • [#473] Add a Nuget badge to readme.md by Richard Webb
  • [#469] Add test for writing using a zero byte buffer by Richard Webb
  • [#389] Simplify Documentation generation by Robin Sue
  • [#437] Add a ZipCrypto/7zip interop test to the ZipEncryptionHandling tests by Richard Webb
  • [#441] Update the benchmark project to BenchmarkDotNet 0.12.1 by Richard Webb
  • [#444] Multi-target unit tests for .NET Core 2.0 and .NET FW 4.6 by Richard Webb
SharpZipLib - v1.2.0

Published by piksel about 5 years ago

Fixes:

  • ZipEntry name mismatch when attempting to delete a directory entry (#295)
  • Revert ArraySegment simplification to speed up CRC32 calculation (#301)
  • Allow AES Zip to better handle reading partial stream data (#308)
  • Always write Zip64 extra size fields when size is -1 (too big for non-Zip64) (#314)
  • Throw exception when attempting to read a zero code length symbol (#316)
    • This should fix most issues where reading Zip-files get stuck in an infinite loop
  • ZipOutputStream.CloseEntry() now works for Stored AES encrypted entries (#323)
  • Empty string is now treated as no RootPath in TarArchive (#336)
  • ZipAESStream now handle reads of less data than the AES block size (#331)
  • Flushing a GZipOutputStream now attempts to deflate all input data before writing it to the underlying stream (#225)
  • StrongEncryption flag is no longer (incorrectly) set for WinzipAES encrypted entries (#329)
  • Attempting to read 0 bytes from a GZipInputStream no longer causes it to hang indefinitely (#372)

Features:

  • HostSystem can now be set for Zipfiles, allowing creation of files targeting Linux filesystems (#325)
  • The SharpZip custom Exception types now implements ISerializable (#369)
    • This allows them to be transmitted when using WCF

Changes:

  • ZipFile constructor now has a leaveOpen parameter (#302)
  • FastZip.ExtractZip now sets isStreamOwner in the ZipFile constructor (#311)
  • ZipFile now always tries to find the Zip64 central directory and prefers it if exists (#363)
    • This will allow for better compatibility with other archivers.
SharpZipLib - v1.1.0

Published by piksel almost 6 years ago

Changes:

  • AES256 decryption now works as intended.
  • AES encryption should also be working but the code is not sufficiently tested and may be buggy.
  • Sourcelink debugging is now enabled and the symbols are included in the nuget package.
  • Overriding the codepage used for the file names and comments is now possible when extracting archives by setting ZipStrings.Codepage or ZipStrings.UseUnicode.
  • Calculating the Adler checksum is now skipped for Zip and Gzip since it's not actually used for the formats. This should greatly improve performance.
SharpZipLib - v1.0.0

Published by piksel about 6 years ago

With the move to .NET Standard and the re-licensing to MIT, effort has been put into creating a stable v1.0 API for SharpZipLib.

Major changes since 0.86:

  • The targeted frameworks are now:
    • .NET Standard 2.0 netstandard2 (Core 2.0+, FW 4.6.1+, Mono 5.2+, UWP 16299)
    • .NET Framework 4.5 net45 (Mono 4, Dependency-free on Windows 8+/2012+)
      See .NET implementation support
  • The library is now released under the MIT license. See Issue #103.
  • The legacy Stream API has been replaced by the IDisposable pattern. (Stream.Close() calls Dispose(true) by default, so it should be backwards compatible)
    See Stream.Close Method.
  • Encoding now works more predictably, defaulting to UTF-8 encoding and correctly specifying it as such.
    See ZipStrings and Unicode.
  • FastZip now prevents traversal outside of the target directory when extracting unless this is explicitly allowed. See Restrict path traversal on FastZip extraction
  • The ICSharpCode.SharpZipLib.Checksums namespace has been renamed ICSharpCode.SharpZipLib.Checksum.

For more detailed notes, see Pre-release version notes.

SharpZipLib - v1.0.0 RC2

Published by piksel about 6 years ago

Changes

  • ZipEntry.IsUnicodeText now defaults to true
  • ZipConstants.DefaultCodePage is now called ZipStrings.CodePage (but backwards-compatible wrappers exists on ZipConstants)
    For more information, see ZipStrings and Unicode

Fixes

SharpZipLib -

Published by McNeight about 8 years ago

Changes for 0.86.0

  • Multi-member gzip files are now supported. Contributed by Geoff Hart.
  • Zero byte files caused ZipOutputStream to create invalid zipfiles. Contributed by Mark Ritchie.
  • ZipFile.CommitUpdate failed on ODT (Open Document) files when updating in memory. Contributed by Dricks.
  • Exceptions occurring within ZipFile.CommitUpdate were being silently discarded.
  • In FastZip, the NameFilter erroneously removed all escapes from regex. Contributed by John Lemberger.
    Note: This is a breaking change - if you had detoured this filter bug via doubled-up backslashes,
    please halve them - for example change @"\myextract.txt$" to @"\myextract.txt$", or
    change "\\myextract.txt$" to "\myextract.txt$".
  • AES Encryption and Decryption is now supported.
  • TarArchive now has IsStreamOwner property, for use with MemoryStream.
  • Removed exception "Extra data contains Zip64 information but version 2.0 is not high enough" due to rogue zip creators.
  • FastZip.ExtractZip now accepts an Input Stream.
  • Zip input and output streams can now specify buffer sizes.
  • Solved "NTFS Extra data invalid" exception when reading zip files with zero-length NTFS ExtraData entry.
  • Fixed "Size mismatch" exceptions reading zips created by SharpZipLib with an explicit entry CRC and Size.
SharpZipLib -

Published by McNeight about 8 years ago

Changes for 0.85.5

  • Fix for unreferenced ZipFile causing read failure after garbage collection.
  • Fix to ZipInputStream.CloseEntry were skipping could fail for long values.
  • Potential race condition flaw in FastZip event handling fixed up.
  • Wrong exceptions being thrown and wrong arguments for some exceptions fixed.
  • TarArchive handling tweaked so creation of archive with Tar streams is handled cleanly
  • ZipFile Testing now handles directories better.
  • DeflatorEngine altered so TotalIn is long.
  • ZipInputStream handles initial reading for entries with no data better.
  • Updates to unit tests
  • BZip2Constants made internal. A breaking change in theory but no-one should be using these values.
  • BZip2 QSort3 optimised somewhat by changing StackElement from class to struct as per lytico suggestion.
  • Name filters allow quoting of ';' characters using ;
  • Fix GZIP flag checking bug
  • ArgumentNull instead of NullReference in tar header now thrown.
  • WindowsNameTransform now used in fastzip
  • Disposed checking in ZipFile beefed up.
  • Bug in entry handling for stored entries and sizing fixed.
  • Zip entries with zero bytes written optimised.
  • TarBuffer.IsEofBlock made obsolete use static TarBuffer.IsEndOfArchiveBlock instead.
  • GZip Finish and Close no longer add extra footers. Close can be called twice without exception. Writes after finish/close now fail.
  • Fastzip now throws exceptions if they are 'handled' via delegates.
SharpZipLib -

Published by McNeight about 8 years ago

Changes for 0.85.4

  • Fix for encryption going awol in Zip archives sometimes
  • Help files updated and now generated by Sandcastle Help File Builder
SharpZipLib -

Published by McNeight about 8 years ago

Changes for 0.85.3

  • Extended unit tests in many areas.
  • Fixed GZip reading of streams larger then 2^32.
  • Windows date time now handled in ExtraData.
  • Extensions to extra data handling.
  • Encrypting stored entries no longer consumes arbitrary amounts of memory.
  • DeflatorOutputStream now uses CryptoTransform
  • ZipInputStream detection of invalid sizes improved.
  • ZipHelperStream reading end of stream values now correctly handled
  • ZipHelperStream now supports reading/writing data descriptors.
  • ZipFile testing data now handles data descriptors.
  • ZipFile adding entries now correctly handles data descriptors.
  • ZipFile now defaults to dynamic use of Zip64.
  • ZipEntryFactory class made public and bugs fixed.
  • ZipEntry DateTime handling cleaned up - Zero is treated as fixed low value and high values checked and handled.
  • Added progress event handling to FastZip.
SharpZipLib -

Published by McNeight about 8 years ago

Changes for 0.85.2.329

  • Minor tweaks for CF, ZipEntryFactory and ZipFile.
  • Fix for zip testing and Zip64 local header patching.
  • FastZip revamped to handle file attributes on extract + other fixes
  • Null ref in path filter fixed.
  • Extra data handling fixes
  • Revamped build and conditional compilation handling
  • Many bug fixes for Zip64.
  • Minor improvements to C# samples.
  • ZIP-1341 Non ascii zip password handling fix.
  • ZIP-355 Fix for zip compression problem at low levels
SharpZipLib -

Published by McNeight about 8 years ago

Changes for v0.85.1.271

  • BREAKING CHANGE: Zip name transform implementations and other classes no longer directly support non-relative paths.
  • Update to Compact Framework handling to cater for CF 2.0 as well as 1.0 (minus encryption for 1.0)
  • Fix for Zip64 descriptor handling.
  • Zip64 handling altered to default to "Zip32" for compatability.
  • Add preliminary implementation for handlng of full unicode names.
  • Fix up encryption handling for ZipFile during updates.
  • Fix for updating bug were comment is the only thing updated.
  • Add IEntryFactory interface and default implementation. Used in FastZip class currently.
  • ZIP-1216 GZipOutputStream header writing delayed allowing the class to be used with HTTP and IIS (via HttpResponse.Filter). This was supposed to be fixed in 0.6 but was ommited.
  • ZIP-149 SVN Revision number incorporated in builds.
  • ZIP-1245 CF Build support added
SharpZipLib -

Published by McNeight about 8 years ago

Changes for v0.85

  • Mod time written in gzip header corrected.
  • Fix for ZipInputStream where closing an open entry wasnt handling all cases correctly.
  • Add support for Zip64 handling to both streams and ZipFile classes.
  • Add ability to modify an existing archive to ZipFile class.
  • Limited FxCop cleanups
  • TarArchive and others made IDisposable.
  • TarOutputStream end-of-file garbage data problem fixed.
  • Zip archive no longer performs zero writes which can cause problems.
  • A bundle of minor bug fixes particularly in the Zip area.
  • Enhanced testing facilities in ZipFile class to allow feedback.

Known issues fixed.

  • ZIP-975 BZip Compress and Decompress stream handling inconsistent.
  • ZIP-517 Stored entry handling were descriptors are specified in flags.
  • ZIP-514 FastZip not firing File/Directory Failure.
  • ZIP-513 HttpResponse exception when writing 0 bytes.
  • ZIP-506 Decryption fails for entry with extended time.
  • ZIP-174 Exception on zero length entries.
SharpZipLib -

Published by McNeight about 8 years ago

Changes for v0.84

  • When skipping to an entry in a zip archive no data is read. This allows password setting after examining the entry to
    see if a password is required, and also allows skipping of entries that cannot be extracted. You cannot skip
    an entry that cannot be extracted if the length is not in the local header.
  • Refactored decryption to make it robust and remove bugs.
  • Fix for reads of zero length in zip files.
  • Fix encryption bug in DeflatorOutputStream.
  • Fix bug when skipping entries
  • Add FastZip class.