From 49f99786da3a3607a8708c2a790d53a068d60758 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garci=CC=81a?= Date: Tue, 9 Apr 2024 11:34:37 +0200 Subject: [PATCH] Switch to results --- crates/bitwarden-wasm/src/client.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/crates/bitwarden-wasm/src/client.rs b/crates/bitwarden-wasm/src/client.rs index f6ac322b8..6bf45cb30 100644 --- a/crates/bitwarden-wasm/src/client.rs +++ b/crates/bitwarden-wasm/src/client.rs @@ -63,7 +63,7 @@ pub fn argon2( iterations: u32, memory: u32, parallelism: u32, -) -> Vec { +) -> Result, JsError> { let argon = Argon2::new( Algorithm::Argon2id, Version::V0x13, @@ -72,11 +72,10 @@ pub fn argon2( iterations, parallelism, Some(32), - ) - .unwrap(), + )?, ); let mut hash = [0u8; 32]; - argon.hash_password_into(password, salt, &mut hash).unwrap(); - hash.to_vec() + argon.hash_password_into(password, salt, &mut hash)?; + Ok(Vec::new()) }