From f671cd39b8789e3bb53eff2f67dea432571b5ced Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Tue, 3 Mar 2020 08:35:55 -0800 Subject: [PATCH] Upgrade hkdf to v0.8.0 --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- src/commands/yubihsm/setup.rs | 2 +- src/connection/secret_connection/kdf.rs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ae0fa1f5..704a7e22 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -770,9 +770,9 @@ dependencies = [ [[package]] name = "hkdf" -version = "0.7.1" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35e8f9d776bbe83f1ff24951f7cc19140fb7ff8d0378463c4c4955f6b0d3e503" +checksum = "3fa08a006102488bd9cd5b8013aabe84955cf5ae22e304c2caf655b633aefae3" dependencies = [ "digest 0.8.1", "hmac", diff --git a/Cargo.toml b/Cargo.toml index 0b05372c..4ac0c383 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,7 @@ chrono = "0.4" getrandom = "0.1" gumdrop = "0.7" hkd32 = { version = "0.3", default-features = false, features = ["mnemonic"] } -hkdf = "0.7" +hkdf = "0.8" hmac = "0.7" once_cell = "1.3" prost-amino = "0.5" diff --git a/src/commands/yubihsm/setup.rs b/src/commands/yubihsm/setup.rs index 6c9fefca..77f53383 100644 --- a/src/commands/yubihsm/setup.rs +++ b/src/commands/yubihsm/setup.rs @@ -254,7 +254,7 @@ fn generate_mnemonic_from_hsm_and_os_csprngs(hsm_connector: &Connector) -> mnemo ikm.extend_from_slice(&[0u8; KEY_SIZE]); getrandom(&mut ikm[KEY_SIZE..]).expect("RNG failure!"); - let kdf = Hkdf::::extract(None, &ikm); + let kdf = Hkdf::::new(None, &ikm); // 32-bytes (256-bits) -> 24 BIP32 words let mut okm = [0u8; KEY_SIZE]; diff --git a/src/connection/secret_connection/kdf.rs b/src/connection/secret_connection/kdf.rs index 6aa3b4eb..3c79ee4a 100644 --- a/src/connection/secret_connection/kdf.rs +++ b/src/connection/secret_connection/kdf.rs @@ -22,7 +22,7 @@ impl Kdf { pub fn derive_secrets_and_challenge(shared_secret: &[u8; 32], loc_is_lo: bool) -> Self { let mut key_material = [0u8; 96]; - Hkdf::::extract(None, shared_secret) + Hkdf::::new(None, shared_secret) .expand(HKDF_INFO, &mut key_material) .unwrap();