Skip to content

Commit

Permalink
chore: Effectively init and zero vector
Browse files Browse the repository at this point in the history
Signed-off-by: Víctor Cuadrado Juan <vcuadradojuan@suse.de>
  • Loading branch information
viccuad committed Oct 10, 2023
1 parent 8ab2696 commit c94d6f7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/crypto/signing_key/kdf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,7 @@ impl ScryptKDF {
self.params.p,
scrypt::Params::RECOMMENDED_LEN,
)?;
let mut res = Vec::new();
res.resize(BOX_KEY_SIZE, 0x00);
let mut res = vec![0; BOX_KEY_SIZE];
scrypt::scrypt(password, &self.salt, &params, &mut res)?;
Ok(res)
}
Expand Down

0 comments on commit c94d6f7

Please sign in to comment.