Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions examples/scram.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,7 @@ impl SimpleQueryHandler for DummyProcessor {
}

pub fn random_salt() -> Vec<u8> {
let mut buf = vec![0u8; 10];
for v in buf.iter_mut() {
*v = rand::random::<u8>();
}
buf
Vec::from(rand::random::<[u8; 10]>())
}

const ITERATIONS: usize = 4096;
Expand Down
7 changes: 1 addition & 6 deletions src/api/auth/scram.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,7 @@ pub fn gen_salted_password(password: &str, salt: &[u8], iters: usize) -> Vec<u8>
}

pub fn random_nonce() -> String {
let mut buf = [0u8; 18];
for v in buf.iter_mut() {
*v = rand::random::<u8>();
}

STANDARD.encode(buf)
STANDARD.encode(rand::random::<[u8; 18]>())
}

impl<A, P> SASLScramAuthStartupHandler<A, P> {
Expand Down