Skip to content

Commit 7e0b116

Browse files
authored
Bump hmac and crypto-mac dependencies to v0.10 (RustCrypto#58)
1 parent 6420db2 commit 7e0b116

File tree

7 files changed

+37
-46
lines changed

7 files changed

+37
-46
lines changed

Cargo.lock

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

bcrypt-pbkdf/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "bcrypt-pbkdf"
33
description = "bcrypt-pbkdf password-based key derivation function"
4-
version = "0.3.0"
4+
version = "0.4.0-pre"
55
authors = ["RustCrypto Developers"]
66
repository = "https://github.com/RustCrypto/password-hashes/tree/master/bcrypt-pbkdf"
77
keywords = ["crypto", "password", "hashing"]
@@ -10,9 +10,9 @@ license = "MIT OR Apache-2.0"
1010
edition = "2018"
1111

1212
[dependencies]
13-
blowfish = { version = "0.6", features = ["bcrypt"] }
14-
crypto-mac = "0.9"
15-
pbkdf2 = { version = "0.5", default-features = false }
13+
blowfish = { version = "0.7", features = ["bcrypt"] }
14+
crypto-mac = "0.10"
15+
pbkdf2 = { version = "0.6.0-pre", default-features = false, path = "../pbkdf2" }
1616
sha2 = { version = "0.9", default-features = false }
1717
zeroize = { version = "1", default-features = false }
1818

pbkdf2/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "pbkdf2"
3-
version = "0.5.0"
3+
version = "0.6.0-pre"
44
authors = ["RustCrypto Developers"]
55
license = "MIT OR Apache-2.0"
66
description = "Generic implementation of PBKDF2"
@@ -11,18 +11,18 @@ categories = ["cryptography", "no-std"]
1111
edition = "2018"
1212

1313
[dependencies]
14-
crypto-mac = "0.9"
14+
crypto-mac = "0.10"
1515

1616
rayon = { version = "1", optional = true }
1717
base64 = { version = "0.13", default-features = false, features = ["alloc"], optional = true }
1818
rand = { version = "0.7", default-features = false, optional = true }
1919
rand_core = { version = "0.5", default-features = false, features = ["getrandom"], optional = true }
20-
hmac = { version = "0.9", default-features = false, optional = true }
20+
hmac = { version = "0.10", default-features = false, optional = true }
2121
sha2 = { version = "0.9", default-features = false, optional = true }
2222
subtle = { version = "2", default-features = false, optional = true }
2323

2424
[dev-dependencies]
25-
hmac = "0.9"
25+
hmac = "0.10"
2626
sha-1 = "0.9"
2727
sha2 = "0.9"
2828

scrypt/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "scrypt"
3-
version = "0.4.1"
3+
version = "0.5.0-pre"
44
authors = ["RustCrypto Developers"]
55
license = "MIT OR Apache-2.0"
66
description = "Scrypt password-based key derivation function"
@@ -11,8 +11,8 @@ categories = ["cryptography"]
1111
edition = "2018"
1212

1313
[dependencies]
14-
hmac = "0.9"
15-
pbkdf2 = { version = "0.5", default-features = false, path = "../pbkdf2" }
14+
hmac = "0.10"
15+
pbkdf2 = { version = "0.6.0-pre", default-features = false, path = "../pbkdf2" }
1616
sha2 = { version = "0.9", default-features = false }
1717

1818
base64 = { version = "0.13", default-features = false, features = ["alloc"], optional = true }

scrypt/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ pub fn scrypt(
7979
// This check required by Scrypt:
8080
// check output.len() > 0 && output.len() <= (2^32 - 1) * 32
8181
if output.is_empty() || output.len() / 32 > 0xffff_ffff {
82-
Err(errors::InvalidOutputLen)?;
82+
return Err(errors::InvalidOutputLen);
8383
}
8484

8585
// The checks in the ScryptParams constructor guarantee

scrypt/src/params.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ impl ScryptParams {
2626
let cond2 = size_of::<usize>() >= size_of::<u32>();
2727
let cond3 = r <= usize::MAX as u32 && p < usize::MAX as u32;
2828
if !(r > 0 && p > 0 && cond1 && (cond2 || cond3)) {
29-
Err(InvalidParams)?;
29+
return Err(InvalidParams);
3030
}
3131

3232
let r = r as usize;
@@ -47,15 +47,15 @@ impl ScryptParams {
4747
// check: n < 2^(128 * r / 8)
4848
// r * 16 won't overflow since r128 didn't
4949
if (log_n as usize) >= r * 16 {
50-
Err(InvalidParams)?;
50+
return Err(InvalidParams);
5151
}
5252

5353
// This check required by Scrypt:
5454
// check: p <= ((2^32-1) * 32) / (128 * r)
5555
// It takes a bit of re-arranging to get the check above into this form,
5656
// but it is indeed the same.
5757
if r * p >= 0x4000_0000 {
58-
Err(InvalidParams)?;
58+
return Err(InvalidParams);
5959
}
6060

6161
Ok(ScryptParams {

scrypt/src/simple.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,6 @@ pub fn scrypt_check(password: &str, hashed_value: &str) -> Result<(), CheckError
135135
if output.ct_eq(&hash).unwrap_u8() == 1 {
136136
Ok(())
137137
} else {
138-
Err(CheckError::HashMismatch)?
138+
Err(CheckError::HashMismatch)
139139
}
140140
}

0 commit comments

Comments
 (0)