mirror of
https://gitlab.com/xmpp-rs/xmpp-rs.git
synced 2024-07-12 22:21:53 +00:00
update base64 and openssl deps
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
This commit is contained in:
parent
3abbdc6409
commit
a7f460f900
2 changed files with 6 additions and 6 deletions
|
@ -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
|
||||
|
|
|
@ -49,14 +49,14 @@ impl ScramProvider for Sha1 {
|
|||
}
|
||||
|
||||
fn hash(data: &[u8]) -> Vec<u8> {
|
||||
hash(MessageDigest::sha1(), data).unwrap()
|
||||
hash(MessageDigest::sha1(), data).unwrap().to_vec()
|
||||
}
|
||||
|
||||
fn hmac(data: &[u8], key: &[u8]) -> Vec<u8> {
|
||||
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<Vec<u8>, String> {
|
||||
|
@ -112,14 +112,14 @@ impl ScramProvider for Sha256 {
|
|||
}
|
||||
|
||||
fn hash(data: &[u8]) -> Vec<u8> {
|
||||
hash(MessageDigest::sha256(), data).unwrap()
|
||||
hash(MessageDigest::sha256(), data).unwrap().to_vec()
|
||||
}
|
||||
|
||||
fn hmac(data: &[u8], key: &[u8]) -> Vec<u8> {
|
||||
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<Vec<u8>, String> {
|
||||
|
|
Loading…
Reference in a new issue