Skip to content
Commit 03f3212b authored by François Degros's avatar François Degros Committed by Copybara-Service
Browse files

[zip] Add ZipReader::SetPassword()

ZipReader can now decrypt encrypted files from ZIP archives.

Use password only for encrypted files. Using a non-null password
triggers an error for non-encrypted files, even if this password is an
empty string.

Note that only the legacy ZipCrypto encryption scheme is currently
supported. The underlying minizip library does not support the more
modern AES encryption schemes.

Added tests:
ZipReaderTest.EncryptedFile_WrongPassword
ZipReaderTest.EncryptedFile_RightPassword
ZipReaderTest.ExtractToFileAsync_Encrypted_NoPassword
ZipReaderTest.ExtractToFileAsync_Encrypted_RightPassword

BUG=chromium:1296838, chromium:953256
TEST=autoninja -C out/Default zlib_unittests && out/Default/zlib_unittests

Change-Id: I01ee66e9c5db2181de565fdf1fa0081b6dd4aa7d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3458783


Reviewed-by: default avatarNoel Gordon <noel@chromium.org>
Commit-Queue: Noel Gordon <noel@chromium.org>
Commit-Queue: François Degros <fdegros@chromium.org>
Cr-Commit-Position: refs/heads/main@{#970508}
NOKEYCHECK=True
GitOrigin-RevId: 4e9e01a391947244e4082302c1739807950c6e71
parent d8f49e6a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment