Skip to content

Commit

Permalink
Handle result
Browse files Browse the repository at this point in the history
Signed-off-by: Christian König <ckoenig@posteo.de>
  • Loading branch information
yubiuser committed Apr 1, 2023
1 parent f3a18a3 commit 79ecf51
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/src/authentication.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ impl Credentials {
return Err(AuthenticationError::Key.into());
}

pbkdf2::<Hmac<Sha1>>(&secret, username.as_bytes(), 0x100, &mut key[0..20]);
let res = pbkdf2::<Hmac<Sha1>>(&secret, username.as_bytes(), 0x100, &mut key[0..20])
assert!(res.is_ok(),"Failed to create hash");


let hash = &Sha1::digest(&key[..20]);
key[..20].copy_from_slice(hash);
Expand Down

0 comments on commit 79ecf51

Please sign in to comment.