From 4b6ffe0cd1c27fa6084cb8663564fb39d632f3be Mon Sep 17 00:00:00 2001 From: Tamo Date: Mon, 2 Jan 2023 16:33:02 +0100 Subject: [PATCH] Update meilisearch-auth/src/lib.rs --- meilisearch-auth/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/meilisearch-auth/src/lib.rs b/meilisearch-auth/src/lib.rs index ea6bf34a0..659447d44 100644 --- a/meilisearch-auth/src/lib.rs +++ b/meilisearch-auth/src/lib.rs @@ -276,6 +276,7 @@ pub fn generate_master_key() -> String { use rand::rngs::OsRng; 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 buf = vec![0; MASTER_KEY_GEN_SIZE]; csprng.fill_bytes(&mut buf);