Update meilisearch-auth/src/lib.rs

This commit is contained in:
Tamo 2023-01-02 16:33:02 +01:00 committed by GitHub
parent 3cba476a9f
commit 4b6ffe0cd1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -276,6 +276,7 @@ pub fn generate_master_key() -> String {
use rand::rngs::OsRng; use rand::rngs::OsRng;
use rand::RngCore; use rand::RngCore;
// We need to use a cryptographically-secure source of randomness. That's why we're using the OsRng; https://crates.io/crates/getrandom
let mut csprng = OsRng; let mut csprng = OsRng;
let mut buf = vec![0; MASTER_KEY_GEN_SIZE]; let mut buf = vec![0; MASTER_KEY_GEN_SIZE];
csprng.fill_bytes(&mut buf); csprng.fill_bytes(&mut buf);