Skip to content

Commit 3cdb50d

Browse files
authored
pkcs5: bump aes, block-modes, hmac, and pbkdf2 (#388)
Bumps the following crate dependencies: - `aes` v0.7 - `block-modes` v0.8 - `hmac` v0.11 - `pkbdf2` v0.8
1 parent d13724f commit 3cdb50d

File tree

8 files changed

+59
-51
lines changed

8 files changed

+59
-51
lines changed

.github/workflows/pkcs5.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
strategy:
2626
matrix:
2727
rust:
28-
- 1.47.0 # MSRV
28+
- 1.49.0 # MSRV
2929
- stable
3030
target:
3131
- thumbv7em-none-eabi
@@ -48,7 +48,7 @@ jobs:
4848
strategy:
4949
matrix:
5050
rust:
51-
- 1.47.0 # MSRV
51+
- 1.49.0 # MSRV
5252
- stable
5353
steps:
5454
- uses: actions/checkout@v1

.github/workflows/pkcs8.yml

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,33 @@ jobs:
4141
override: true
4242
- run: cargo build --release --target ${{ matrix.target }} --no-default-features
4343
- run: cargo build --release --target ${{ matrix.target }} --no-default-features --features alloc
44-
- run: cargo build --release --target ${{ matrix.target }} --no-default-features --features encryption
4544
- run: cargo build --release --target ${{ matrix.target }} --no-default-features --features pem
46-
- run: cargo build --release --target ${{ matrix.target }} --no-default-features --features pkcs5
45+
46+
# `pkcs5` crate is MSRV 1.49+
47+
encryption:
48+
runs-on: ubuntu-latest
49+
strategy:
50+
matrix:
51+
rust:
52+
- 1.49.0 # MSRV
53+
- stable
54+
target:
55+
- thumbv7em-none-eabi
56+
- wasm32-unknown-unknown
57+
steps:
58+
- uses: actions/checkout@v1
59+
- uses: actions-rs/toolchain@v1
60+
with:
61+
profile: minimal
62+
toolchain: ${{ matrix.rust }}
63+
target: ${{ matrix.target }}
64+
override: true
65+
- run: cargo build --release --target ${{ matrix.target }} --no-default-features
66+
- run: cargo build --release --target ${{ matrix.target }} --no-default-features --features alloc
67+
- run: cargo build --release --target ${{ matrix.target }} --no-default-features --features pem
68+
- run: cargo test --release --features encryption
69+
- run: cargo test --release --features pkcs5
70+
- run: cargo test --release --all-features
4771

4872
test:
4973
runs-on: ubuntu-latest
@@ -62,7 +86,4 @@ jobs:
6286
- run: cargo test --release --no-default-features
6387
- run: cargo test --release
6488
- run: cargo test --release --features alloc
65-
- run: cargo test --release --features encryption
6689
- run: cargo test --release --features pem
67-
- run: cargo test --release --features pkcs5
68-
- run: cargo test --release --all-features

.github/workflows/workspace.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- uses: actions/checkout@v1
1717
- uses: actions-rs/toolchain@v1
1818
with:
19-
toolchain: 1.47.0 # Highest MSRV in repo
19+
toolchain: 1.49.0 # Highest MSRV in repo
2020
components: clippy
2121
override: true
2222
profile: minimal

Cargo.lock

Lines changed: 20 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkcs5/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ readme = "README.md"
1717
der = { version = "0.3", features = ["oid"], path = "../der" }
1818
spki = { version = "0.3", path = "../spki" }
1919

20-
aes = { version = "0.6", optional = true }
21-
block-modes = { version = "0.7", optional = true, default-features = false }
22-
hmac = { version = "0.10", optional = true, default-features = false }
23-
pbkdf2 = { version = "0.7", optional = true, default-features = false }
20+
aes = { version = "0.7", optional = true }
21+
block-modes = { version = "0.8", optional = true, default-features = false }
22+
hmac = { version = "0.11", optional = true, default-features = false }
23+
pbkdf2 = { version = "0.8", optional = true, default-features = false }
2424
sha2 = { version = "0.9", optional = true, default-features = false }
2525

2626
[dev-dependencies]

pkcs5/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ dual licensed as above, without any additional terms or conditions.
3434
[docs-image]: https://docs.rs/pkcs5/badge.svg
3535
[docs-link]: https://docs.rs/pkcs5/
3636
[license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg
37-
[rustc-image]: https://img.shields.io/badge/rustc-1.47+-blue.svg
37+
[rustc-image]: https://img.shields.io/badge/rustc-1.49+-blue.svg
3838
[chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg
3939
[chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260052-utils
4040
[build-image]: https://github.com/RustCrypto/utils/workflows/pkcs5/badge.svg?branch=master&event=push

pkcs5/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//!
55
//! # Minimum Supported Rust Version
66
//!
7-
//! This crate requires **Rust 1.47** at a minimum.
7+
//! This crate requires **Rust 1.49** at a minimum.
88
//!
99
//! # Usage
1010
//!

pkcs5/src/pbes2/encryption.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ pub fn encrypt_in_place<'b>(
3333

3434
match params.encryption {
3535
EncryptionScheme::Aes128Cbc { iv } => {
36-
let cipher = Aes128Cbc::new_var(key.as_slice(), iv).map_err(|_| CryptoError)?;
36+
let cipher = Aes128Cbc::new_from_slices(key.as_slice(), iv).map_err(|_| CryptoError)?;
3737
cipher.encrypt(buffer, pos).map_err(|_| CryptoError)
3838
}
3939
EncryptionScheme::Aes256Cbc { iv } => {
40-
let cipher = Aes256Cbc::new_var(key.as_slice(), iv).map_err(|_| CryptoError)?;
40+
let cipher = Aes256Cbc::new_from_slices(key.as_slice(), iv).map_err(|_| CryptoError)?;
4141
cipher.encrypt(buffer, pos).map_err(|_| CryptoError)
4242
}
4343
}
@@ -59,11 +59,11 @@ pub fn decrypt_in_place<'a>(
5959

6060
match params.encryption {
6161
EncryptionScheme::Aes128Cbc { iv } => {
62-
let cipher = Aes128Cbc::new_var(key.as_slice(), iv).map_err(|_| CryptoError)?;
62+
let cipher = Aes128Cbc::new_from_slices(key.as_slice(), iv).map_err(|_| CryptoError)?;
6363
cipher.decrypt(buffer).map_err(|_| CryptoError)
6464
}
6565
EncryptionScheme::Aes256Cbc { iv } => {
66-
let cipher = Aes256Cbc::new_var(key.as_slice(), iv).map_err(|_| CryptoError)?;
66+
let cipher = Aes256Cbc::new_from_slices(key.as_slice(), iv).map_err(|_| CryptoError)?;
6767
cipher.decrypt(buffer).map_err(|_| CryptoError)
6868
}
6969
}

0 commit comments

Comments
 (0)