From 46f65d4d49f9f181f2889d04dbca97a51f7c0f2b Mon Sep 17 00:00:00 2001 From: Lireer Date: Mon, 9 Nov 2020 17:20:17 +0100 Subject: [PATCH] add aes-crypto feature to default and update README --- Cargo.toml | 2 +- README.md | 3 ++- src/aes.rs | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 1d02bd3d..5aaf2660 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,7 +34,7 @@ deflate = ["flate2/rust_backend"] deflate-miniz = ["flate2/default"] deflate-zlib = ["flate2/zlib"] unreserved = [] -default = ["bzip2", "deflate", "time"] +default = ["aes-crypto", "bzip2", "deflate", "time"] [[bench]] name = "read_entry" diff --git a/README.md b/README.md index b4df15a7..85427f0c 100644 --- a/README.md +++ b/README.md @@ -42,8 +42,9 @@ zip = { version = "0.5", default-features = false } 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. +* `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. All of these are enabled by default. diff --git a/src/aes.rs b/src/aes.rs index 001a2804..79cc0170 100644 --- a/src/aes.rs +++ b/src/aes.rs @@ -2,7 +2,7 @@ //! //! 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. -//! 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::types::AesMode;