From 8ead6e6c69e049c6b7ca67432e781a7429f76056 Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Wed, 8 Dec 2021 18:30:44 -0500 Subject: [PATCH] Update hash crates --- postgres-protocol/Cargo.toml | 6 +++--- postgres-protocol/src/authentication/sasl.rs | 4 ++-- postgres-protocol/src/password/mod.rs | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/postgres-protocol/Cargo.toml b/postgres-protocol/Cargo.toml index a4ed3e90..638778f2 100644 --- a/postgres-protocol/Cargo.toml +++ b/postgres-protocol/Cargo.toml @@ -13,9 +13,9 @@ base64 = "0.13" byteorder = "1.0" bytes = "1.0" fallible-iterator = "0.2" -hmac = "0.11" -md-5 = "0.9" +hmac = "0.12" +md-5 = "0.10" memchr = "2.0" rand = "0.8" -sha2 = "0.9" +sha2 = "0.10" stringprep = "0.1" diff --git a/postgres-protocol/src/authentication/sasl.rs b/postgres-protocol/src/authentication/sasl.rs index a3704ce1..ea2f55ca 100644 --- a/postgres-protocol/src/authentication/sasl.rs +++ b/postgres-protocol/src/authentication/sasl.rs @@ -1,6 +1,6 @@ //! SASL-based authentication support. -use hmac::{Hmac, Mac, NewMac}; +use hmac::{Hmac, Mac}; use rand::{self, Rng}; use sha2::digest::FixedOutput; use sha2::{Digest, Sha256}; @@ -275,7 +275,7 @@ impl ScramSha256 { let mut hmac = Hmac::::new_from_slice(&server_key) .expect("HMAC is able to accept all key sizes"); hmac.update(auth_message.as_bytes()); - hmac.verify(&verifier) + hmac.verify_slice(&verifier) .map_err(|_| io::Error::new(io::ErrorKind::InvalidInput, "SCRAM verification error")) } } diff --git a/postgres-protocol/src/password/mod.rs b/postgres-protocol/src/password/mod.rs index 1b32ae8f..a60687bb 100644 --- a/postgres-protocol/src/password/mod.rs +++ b/postgres-protocol/src/password/mod.rs @@ -7,7 +7,7 @@ //! end up in logs pg_stat displays, etc. use crate::authentication::sasl; -use hmac::{Hmac, Mac, NewMac}; +use hmac::{Hmac, Mac}; use md5::Md5; use rand::RngCore; use sha2::digest::FixedOutput;