Handler::register should be use a a password generator that implements Send
Closed this issue · 1 comments
nanu-c commented
In order to register in a thread, the all functions should implement the Send
trait.
We could change -> https://github.com/whisperfish/presage/blob/main/src/manager.rs#L189
// generate a random 24 bytes password
let rng = rand::thread_rng();
let password: String = rng.sample_iter(&Alphanumeric).take(24).collect();
to
// generate a send safe random 24 bytes password
let mut rng = StdRng::from_entropy();
// Generate a 24-byte password as a vector of bytes.
let password_vec: Vec<u8> = (0..24).map(|_| rng.gen()).collect();
let password = hex::encode(password_vec);