diff --git a/src/secure/signed.rs b/src/secure/signed.rs index 2390f17..954866e 100644 --- a/src/secure/signed.rs +++ b/src/secure/signed.rs @@ -33,7 +33,7 @@ impl<'a> SignedJar<'a> { /// Signs the cookie's value providing integrity and authenticity. fn sign_cookie(&self, cookie: &mut Cookie) { // Compute HMAC-SHA256 of the cookie's value. - let mut mac = Hmac::::new_varkey(&self.key).expect("good key"); + let mut mac = Hmac::::new_from_slice(&self.key).expect("good key"); mac.update(cookie.value().as_bytes()); // Cookie's new value is [MAC | original-value]. @@ -55,7 +55,7 @@ impl<'a> SignedJar<'a> { let digest = base64::decode(digest_str).map_err(|_| "bad base64 digest")?; // Perform the verification. - let mut mac = Hmac::::new_varkey(&self.key).expect("good key"); + let mut mac = Hmac::::new_from_slice(&self.key).expect("good key"); mac.update(value.as_bytes()); mac.verify(&digest) .map(|_| value.to_string())