This commit is contained in:
Sosthene 2024-05-03 13:52:39 +02:00
parent e26ea1068d
commit 46fded3791

View File

@ -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()
}