Skip to content

Commit

Permalink
Switch to results
Browse files Browse the repository at this point in the history
  • Loading branch information
dani-garcia committed Apr 9, 2024
1 parent 4ebd280 commit 49f9978
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions crates/bitwarden-wasm/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ pub fn argon2(
iterations: u32,
memory: u32,
parallelism: u32,
) -> Vec<u8> {
) -> Result<Vec<u8>, JsError> {
let argon = Argon2::new(
Algorithm::Argon2id,
Version::V0x13,
Expand All @@ -72,11 +72,10 @@ pub fn argon2(
iterations,
parallelism,
Some(32),
)
.unwrap(),
)?,

Check warning on line 75 in crates/bitwarden-wasm/src/client.rs

View check run for this annotation

Codecov / codecov/patch

crates/bitwarden-wasm/src/client.rs#L59-L75

Added lines #L59 - L75 were not covered by tests
);

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

Check warning on line 81 in crates/bitwarden-wasm/src/client.rs

View check run for this annotation

Codecov / codecov/patch

crates/bitwarden-wasm/src/client.rs#L78-L81

Added lines #L78 - L81 were not covered by tests

0 comments on commit 49f9978

Please sign in to comment.