From 7fe65607f3dece1dbe766d2e7cb7fc8f89b4a7df Mon Sep 17 00:00:00 2001 From: Marli Frost Date: Sun, 12 Feb 2023 11:07:10 +0000 Subject: [PATCH 1/2] update aes to 0.8 (hazard): The changelog in aes doesn't indicate any change in behaviour, and I have assumed the new APIs work identically --- Cargo.toml | 2 +- src/aes_ctr.rs | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index caf6a07f..784d2f35 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ Library to support the reading and writing of zip files. edition = "2018" [dependencies] -aes = { version = "0.7.5", optional = true } +aes = { version = "0.8.2", optional = true } byteorder = "1.4.3" bzip2 = { version = "0.4.3", optional = true } constant_time_eq = { version = "0.1.5", optional = true } diff --git a/src/aes_ctr.rs b/src/aes_ctr.rs index 0f34335c..211727c0 100644 --- a/src/aes_ctr.rs +++ b/src/aes_ctr.rs @@ -2,10 +2,11 @@ //! //! This was implemented since the zip specification requires the mode to not use a nonce and uses a //! different byte order (little endian) than NIST (big endian). -//! See [AesCtrZipKeyStream](./struct.AesCtrZipKeyStream.html) for more information. +//! See [AesCtrZipKeyStream] for more information. use aes::cipher::generic_array::GenericArray; -use aes::{BlockEncrypt, NewBlockCipher}; +// use aes::{BlockEncrypt, NewBlockCipher}; +use aes::cipher::{BlockEncrypt, KeyInit}; use byteorder::WriteBytesExt; use std::{any, fmt}; @@ -82,7 +83,7 @@ where impl AesCtrZipKeyStream where C: AesKind, - C::Cipher: NewBlockCipher, + C::Cipher: KeyInit, { /// Creates a new zip variant AES-CTR key stream. /// @@ -150,14 +151,14 @@ fn xor(dest: &mut [u8], src: &[u8]) { #[cfg(test)] mod tests { use super::{Aes128, Aes192, Aes256, AesCipher, AesCtrZipKeyStream, AesKind}; - use aes::{BlockEncrypt, NewBlockCipher}; + use aes::cipher::{BlockEncrypt, KeyInit}; /// Checks whether `crypt_in_place` produces the correct plaintext after one use and yields the /// cipertext again after applying it again. fn roundtrip(key: &[u8], ciphertext: &mut [u8], expected_plaintext: &[u8]) where Aes: AesKind, - Aes::Cipher: NewBlockCipher + BlockEncrypt, + Aes::Cipher: KeyInit + BlockEncrypt, { let mut key_stream = AesCtrZipKeyStream::::new(key); From 21a20584bc9e05dfa4f3c5b0bc420a1389fae2c3 Mon Sep 17 00:00:00 2001 From: Marli Frost Date: Tue, 16 May 2023 07:40:54 +0100 Subject: [PATCH 2/2] publish 0.6.6 with aes 0.8 --- CHANGELOG.md | 5 +++++ Cargo.toml | 2 +- README.md | 4 ++-- src/lib.rs | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4faa68d6..96c6994f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## [0.6.6] +### Changed + +- Updated `aes` dependency to `0.8.2` (https://github.com/zip-rs/zip/pull/354) + ## [0.6.5] ### Changed diff --git a/Cargo.toml b/Cargo.toml index 6ff550a7..510df9ca 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "zip" -version = "0.6.5" +version = "0.6.6" authors = ["Mathijs van de Nes ", "Marli Frost ", "Ryan Levick "] license = "MIT" repository = "https://github.com/zip-rs/zip.git" diff --git a/README.md b/README.md index 584a747e..f06cdbb5 100644 --- a/README.md +++ b/README.md @@ -32,14 +32,14 @@ With all default features: ```toml [dependencies] -zip = "5" +zip = "0.6" ``` Without the default features: ```toml [dependencies] -zip = { version = "0.6.5", default-features = false } +zip = { version = "0.6.6", default-features = false } ``` The features available are: diff --git a/src/lib.rs b/src/lib.rs index 328b7e39..e2228e5b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -50,6 +50,6 @@ mod zipcrypto; /// /// ```toml /// [dependencies] -/// zip = "=0.6.5" +/// zip = "=0.6.6" /// ``` pub mod unstable;