From 46fded3791600bf014bb33144c2085a0d8654c0b Mon Sep 17 00:00:00 2001 From: Sosthene Date: Fri, 3 May 2024 13:52:39 +0200 Subject: [PATCH] bug fix --- crates/sp_client/src/user.rs | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/crates/sp_client/src/user.rs b/crates/sp_client/src/user.rs index 758c4f2..5038554 100644 --- a/crates/sp_client/src/user.rs +++ b/crates/sp_client/src/user.rs @@ -363,12 +363,8 @@ impl User { engine.write_all(&entropy); let hash = sha256::Hash::from_engine(engine); - let aes_dec = Aes256Decryption::new( - Purpose::ThirtyTwoBytes, - ciphertext, - hash.to_byte_array().to_vec(), - None, - )?; + let aes_dec = + Aes256Decryption::new(Purpose::ThirtyTwoBytes, ciphertext, hash.to_byte_array())?; aes_dec.decrypt_with_key() } @@ -379,12 +375,7 @@ impl User { engine.write_all(&entropy); let hash = sha256::Hash::from_engine(engine); - let aes_dec = Aes256Decryption::new( - Purpose::Login, - ciphertext, - hash.to_byte_array().to_vec(), - None, - )?; + let aes_dec = Aes256Decryption::new(Purpose::Login, ciphertext, hash.to_byte_array())?; aes_dec.decrypt_with_key() } @@ -403,12 +394,7 @@ impl User { .ok_or_else(|| anyhow::Error::msg("Failed to retrieve the sharded secret"))?, )?; - let aes_dec = Aes256Decryption::new( - Purpose::Login, - part2_key_enc, - hash.to_byte_array().to_vec(), - None, - )?; + let aes_dec = Aes256Decryption::new(Purpose::Login, part2_key_enc, hash.to_byte_array())?; aes_dec.decrypt_with_key() }