Skip to content

Commit

Permalink
Update RustCrypto dependencies.
Browse files Browse the repository at this point in the history
Updates the following RustCrypto dependencies to the latest versions:

  * `hmac` to v0.12.0
  * `sha2` to v0.10.0
  * `hkdf` to v0.12.0

MSRV is now 1.53.
  • Loading branch information
SergioBenitez committed Dec 29, 2021
1 parent 6af6e6f commit 27d0684
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ percent-encoding = { version = "2.0", optional = true }

# dependencies for secure (private/signed) functionality
aes-gcm = { version = "0.9.0", optional = true }
hmac = { version = "0.11.0", optional = true }
sha2 = { version = "0.9.0", optional = true }
hmac = { version = "0.12.0", optional = true }
sha2 = { version = "0.10.0", optional = true }
base64 = { version = "0.13", optional = true }
rand = { version = "0.8", optional = true }
hkdf = { version = "0.11.0", optional = true }
hkdf = { version = "0.12.0", optional = true }
subtle = { version = "2.3", optional = true }

[build-dependencies]
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ See the [documentation](http://docs.rs/cookie) for detailed usage information.

# MSRV

The minimum supported `rustc` version for cookie `0.16` is `1.48` _without_
`secure` features enabled and `1.49` otherwise.
khe minimum supported `rustc` version for cookie `0.16` is `1.53`.

The minimum supported `rustc` version for cookie `0.15` is `1.41`.

Expand Down
4 changes: 2 additions & 2 deletions src/secure/signed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::convert::TryInto;
use std::borrow::{Borrow, BorrowMut};

use sha2::Sha256;
use hmac::{Hmac, Mac, NewMac};
use hmac::{Hmac, Mac};

use crate::secure::{base64, Key};
use crate::{Cookie, CookieJar};
Expand Down Expand Up @@ -60,7 +60,7 @@ impl<J> SignedJar<J> {
// Perform the verification.
let mut mac = Hmac::<Sha256>::new_from_slice(&self.key).expect("good key");
mac.update(value.as_bytes());
mac.verify(&digest)
mac.verify_slice(&digest)
.map(|_| value.to_string())
.map_err(|_| "value did not verify")
}
Expand Down

0 comments on commit 27d0684

Please sign in to comment.