add aes-crypto feature to default and update README

This commit is contained in:
Lireer 2020-11-09 17:20:17 +01:00 committed by Lireer
parent 09ad713d20
commit 46f65d4d49
3 changed files with 4 additions and 3 deletions

View file

@ -34,7 +34,7 @@ deflate = ["flate2/rust_backend"]
deflate-miniz = ["flate2/default"] deflate-miniz = ["flate2/default"]
deflate-zlib = ["flate2/zlib"] deflate-zlib = ["flate2/zlib"]
unreserved = [] unreserved = []
default = ["bzip2", "deflate", "time"] default = ["aes-crypto", "bzip2", "deflate", "time"]
[[bench]] [[bench]]
name = "read_entry" name = "read_entry"

View file

@ -42,8 +42,9 @@ zip = { version = "0.5", default-features = false }
The features available are: The features available are:
* `deflate`: Enables the deflate compression algorithm, which is the default for zipfiles * `aes-crypto`: Enables decryption of files which were encrypted with AES. Supports AE-1 and AE-2 methods.
* `bzip2`: Enables the BZip2 compression algorithm. * `bzip2`: Enables the BZip2 compression algorithm.
* `deflate`: Enables the deflate compression algorithm, which is the default for zipfiles
* `time`: Enables features using the [time](https://github.com/rust-lang-deprecated/time) crate. * `time`: Enables features using the [time](https://github.com/rust-lang-deprecated/time) crate.
All of these are enabled by default. All of these are enabled by default.

View file

@ -2,7 +2,7 @@
//! //!
//! This was implemented according to the [WinZip specification](https://www.winzip.com/win/en/aes_info.html). //! This was implemented according to the [WinZip specification](https://www.winzip.com/win/en/aes_info.html).
//! Note that using CRC with AES depends on the specific encryption specification used, AE-1 or AE-2. //! Note that using CRC with AES depends on the specific encryption specification used, AE-1 or AE-2.
//! AE-2 doesn't set the CRC field correctly, even though some zip files still have CRC set even with AE-2. //! If the file is marked as encrypted with AE-2 the CRC field is ignored, even if it isn't set to 0.
use crate::aes_ctr; use crate::aes_ctr;
use crate::types::AesMode; use crate::types::AesMode;