Skip to content

Commit

Permalink
Replace hex with base64ct::Base64
Browse files Browse the repository at this point in the history
Signed-off-by: Arthur Chan <arthur.chan@adalogics.com>
  • Loading branch information
arthurscchan committed Oct 21, 2024
1 parent c279685 commit 3d4fb68
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ cargo-fuzz = true
[dependencies]
libfuzzer-sys = "0.4"
scrypt = { path = "../scrypt", features = ["simple"]}
hex = "0.4"

[[bin]]
name = "scrypt_fuzzer"
Expand Down
2 changes: 1 addition & 1 deletion fuzz/fuzz_targets/scrypt_fuzzer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ fuzz_target!(|data: &[u8]| {

let salt_value = salt_string.as_salt(); // Safe to use now

let formatted_hash = format!("$scrypt$ln=16,r=8,p=1${}$invalid$", hex::encode(password));
let formatted_hash = format!("$scrypt$ln=16,r=8,p=1${}$invalid$", base64ct::Base64::encode_string(password));

if let Ok(hash) =
PasswordHash::new(SAMPLE_HASH).or_else(|_| PasswordHash::new(formatted_hash.as_str()))
Expand Down

0 comments on commit 3d4fb68

Please # to comment.