From 5180e55a6487be6188c9e2144f1839ed997840a7 Mon Sep 17 00:00:00 2001 From: Marc-Antoine Perennou Date: Tue, 27 Feb 2018 11:44:41 +0100 Subject: [PATCH] update base64 and openssl deps Signed-off-by: Marc-Antoine Perennou --- sasl/Cargo.toml | 4 ++-- sasl/src/common/scram.rs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sasl/Cargo.toml b/sasl/Cargo.toml index 34169540..62c6ec99 100644 --- a/sasl/Cargo.toml +++ b/sasl/Cargo.toml @@ -18,8 +18,8 @@ default = ["scram"] scram = ["openssl"] [dependencies] -base64 = "0.6.0" +base64 = "0.9.0" [dependencies.openssl] -version = "0.9.13" +version = "0.10.4" optional = true diff --git a/sasl/src/common/scram.rs b/sasl/src/common/scram.rs index 8ebe4aaa..f9bae91d 100644 --- a/sasl/src/common/scram.rs +++ b/sasl/src/common/scram.rs @@ -46,14 +46,14 @@ impl ScramProvider for Sha1 { // TODO: look at all these unwraps fn name() -> &'static str { "SHA-1" } fn hash(data: &[u8]) -> Vec { - hash(MessageDigest::sha1(), data).unwrap() + hash(MessageDigest::sha1(), data).unwrap().to_vec() } fn hmac(data: &[u8], key: &[u8]) -> Vec { let pkey = PKey::hmac(key).unwrap(); let mut signer = Signer::new(MessageDigest::sha1(), &pkey).unwrap(); signer.update(data).unwrap(); - signer.finish().unwrap() + signer.sign_to_vec().unwrap() } fn derive(password: &Password, salt: &[u8], iterations: usize) -> Result, String> { @@ -90,14 +90,14 @@ impl ScramProvider for Sha256 { // TODO: look at all these unwraps fn name() -> &'static str { "SHA-256" } fn hash(data: &[u8]) -> Vec { - hash(MessageDigest::sha256(), data).unwrap() + hash(MessageDigest::sha256(), data).unwrap().to_vec() } fn hmac(data: &[u8], key: &[u8]) -> Vec { let pkey = PKey::hmac(key).unwrap(); let mut signer = Signer::new(MessageDigest::sha256(), &pkey).unwrap(); signer.update(data).unwrap(); - signer.finish().unwrap() + signer.sign_to_vec().unwrap() } fn derive(password: &Password, salt: &[u8], iterations: usize) -> Result, String> {