Skip to content

Update hash crates #849

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions postgres-protocol/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
4 changes: 2 additions & 2 deletions postgres-protocol/src/authentication/sasl.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down Expand Up @@ -275,7 +275,7 @@ impl ScramSha256 {
let mut hmac = Hmac::<Sha256>::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"))
}
}
Expand Down
2 changes: 1 addition & 1 deletion postgres-protocol/src/password/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion tokio-postgres/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ impl<'a> UrlParser<'a> {
}

fn take_all(&mut self) -> &'a str {
mem::replace(&mut self.s, "")
mem::take(&mut self.s)
}

fn eat_byte(&mut self) {
Expand Down