Fixed incorrect handling of long odd length passwords
2 files changed
tree: b92aaf2bfbcbd3633afac4534b9247d48f58b542
  1. .github/
  2. cmake/
  3. doc/
  4. test/
  5. .codecov.yaml
  6. .gitignore
  7. CMakeLists.txt
  8. INDEX.md
  9. LICENSE
  10. minigzip.c
  11. minizip.c
  12. minizip.pc.cmakein
  13. mz.h
  14. mz_compat.c
  15. mz_compat.h
  16. mz_compat_shim.h.in
  17. mz_crypt.c
  18. mz_crypt.h
  19. mz_crypt_apple.c
  20. mz_crypt_openssl.c
  21. mz_crypt_win32.c
  22. mz_crypt_winrt.c
  23. mz_os.c
  24. mz_os.h
  25. mz_os_posix.c
  26. mz_os_win32.c
  27. mz_strm.c
  28. mz_strm.h
  29. mz_strm_buf.c
  30. mz_strm_buf.h
  31. mz_strm_bzip.c
  32. mz_strm_bzip.h
  33. mz_strm_libcomp.c
  34. mz_strm_libcomp.h
  35. mz_strm_lzma.c
  36. mz_strm_lzma.h
  37. mz_strm_mem.c
  38. mz_strm_mem.h
  39. mz_strm_os.h
  40. mz_strm_os_posix.c
  41. mz_strm_os_win32.c
  42. mz_strm_pkcrypt.c
  43. mz_strm_pkcrypt.h
  44. mz_strm_split.c
  45. mz_strm_split.h
  46. mz_strm_wzaes.c
  47. mz_strm_wzaes.h
  48. mz_strm_zlib.c
  49. mz_strm_zlib.h
  50. mz_strm_zstd.c
  51. mz_strm_zstd.h
  52. mz_zip.c
  53. mz_zip.h
  54. mz_zip_rw.c
  55. mz_zip_rw.h
  56. README.md
README.md

minizip-ng

minizip-ng is a zip manipulation library written in C that is supported on Windows, macOS, and Linux.

Master Branch Status Fuzzing Status License: Zlib codecov.io

Developed and maintained by Nathan Moinvaziri.

Branches

NameDescription
masterMost recent release.
developLatest development code.
1.2Old changes to original minizip that includes WinZip AES encryption, disk splitting, I/O buffering and some additional fixes. Not ABI compatible with original minizip.
1.1Original minizip as of zlib 1.2.11.

History

Minizip was originally developed by Gilles Vollant in 1998. It was first included in the zlib distribution as an additional code contribution starting in zlib 1.1.2. Since that time, it has been continually improved upon and contributed to by many people. The original project can still be found in the zlib distribution that is maintained by Mark Adler.

The motivation behind this repository has been the need for new features and bug fixes to the original library which had not been maintained for a long period of time. The code has been largely refactored and rewritten in order to help improve maintainability and readability. A compatibility layer has been provided for consumers of the original minizip library.

Features

  • Creating and extracting zip archives.
  • Adding and removing entries from zip archives.
  • Read and write raw zip entry data.
  • Reading and writing zip archives from memory.
  • Support for large files with ZIP64 extension.
  • Zlib, BZIP2, LZMA, XZ, and ZSTD compression methods.
  • Password protection through Traditional PKWARE and WinZIP AES encryption.
  • Buffered streaming for improved I/O performance.
  • NTFS timestamp support for UTC last modified, last accessed, and creation dates.
  • Disk split support for splitting zip archives into multiple files.
  • Preservation of file attributes across file systems.
  • Follow and store symbolic links.
  • Unicode filename support through UTF-8 encoding.
  • Legacy character encoding support CP437, CP932, CP936, CP950.
  • Turn off compilation of compression, decompression, or encryption.
  • Windows (Win32 & WinRT), macOS and Linux platform support.
  • Streaming interface for easy implementation of additional platforms.
  • Support for Apple's compression library ZLIB and XZ implementations.
  • Zero out local file header information.
  • Zip/unzip of central directory to reduce size.
  • Ability to generate and verify CMS signature for each entry.
  • Recover the central directory if it is corrupt or missing.
  • Example minizip and minigzip command line tools.

Build

To generate project files for your platform:

  1. Download and install cmake (version 3.11 or later recommended).
  2. Run cmake in the minizip directory.
cmake -S . -B build -D MZ_BUILD_TESTS=ON
cmake --build build

Build Options

NameDescriptionDefault Value
MZ_COMPATEnables compatibility layerON
MZ_ZLIBEnables ZLIB compressionON
MZ_BZIP2Enables BZIP2 compressionON
MZ_LZMAEnables LZMA & XZ compressionON
MZ_ZSTDEnables ZSTD compressionON
MZ_LIBCOMPEnables Apple compressionAPPLE
MZ_FETCH_LIBSEnables fetching third-party libraries if not foundWIN32
MZ_FORCE_FETCH_LIBSEnables fetching third-party libraries alwaysOFF
MZ_PKCRYPTEnables PKWARE traditional encryptionON
MZ_WZAESEnables WinZIP AES encryptionON
MZ_BCRYPTBuilds with Win32 Crypto API New Generation (CNG)OFF
MZ_OPENSSLEnables OpenSSL encryptionUNIX
MZ_LIBBSDBuilds with libbsd crypto randomUNIX
MZ_SIGNINGEnables zip signing supportOFF
MZ_ICONVEnables iconv encoding conversionON
MZ_COMPRESS_ONLYOnly support compressionOFF
MZ_DECOMPRESS_ONLYOnly support decompressionOFF
MZ_FILE32_APIBuilds using posix 32-bit file apiOFF
MZ_BUILD_TESTSBuilds minizip test executableOFF
MZ_BUILD_UNIT_TESTSBuilds minizip unit test projectOFF
MZ_BUILD_FUZZ_TESTSBuilds minizip fuzz executablesOFF
MZ_CODE_COVERAGEBuild with code coverage flagsOFF
MZ_PROJECT_SUFFIXProject name suffix for packaging

Third-Party Libraries

Third-party libraries may be required based on the CMake options selected. If the system already has the library installed then it will be used, otherwise CMake will retrieve the source code for the library from its official git repository and compile it in when the MZ_FETCH_LIBS option is enabled.

ProjectLicenseCMake OptionComments
bzip2licenseMZ_BZIP2Written by Julian Seward.
liblzmaPublic domainMZ_LZMAWritten by Igor Pavlov and Lasse Collin.
zlibzlibMZ_ZLIBWritten by Mark Adler and Jean-loup Gailly. Or alternatively, zlib-ng by Hans Kristian Rosbach.
zstdBSDMZ_ZSTDWritten by Facebook.

This project uses the zlib license.

Acknowledgments

Thanks go out to all the people who have taken the time to contribute code reviews, testing and/or patches. This project would not have been as good without you.

Thanks to Gilles Vollant on which this work is originally based on.

The ZIP format was defined by Phil Katz of PKWARE.