From 6da4cf1425f415dc0ee69310a55a4eeb8cd226a5 Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Sun, 9 Feb 2025 17:59:55 +0100 Subject: [PATCH] Fixed renamed function after upgrading `rand_chacha` and `rand` --- runtime/src/api_token.rs | 2 +- runtime/src/encryption.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/src/api_token.rs b/runtime/src/api_token.rs index 3fe1f182..31759185 100644 --- a/runtime/src/api_token.rs +++ b/runtime/src/api_token.rs @@ -8,7 +8,7 @@ use rocket::request::FromRequest; /// The API token used to authenticate requests. pub static API_TOKEN: Lazy = Lazy::new(|| { let mut token = [0u8; 32]; - let mut rng = rand_chacha::ChaChaRng::from_entropy(); + let mut rng = rand_chacha::ChaChaRng::from_os_rng(); rng.fill_bytes(&mut token); let token = APIToken::from_bytes(token.to_vec()); diff --git a/runtime/src/encryption.rs b/runtime/src/encryption.rs index d28dbf27..632915d7 100644 --- a/runtime/src/encryption.rs +++ b/runtime/src/encryption.rs @@ -32,7 +32,7 @@ pub static ENCRYPTION: Lazy = Lazy::new(|| { // We use a cryptographically secure pseudo-random number generator // to generate the secret password & salt. ChaCha20Rng is the algorithm // of our choice: - let mut rng = rand_chacha::ChaChaRng::from_entropy(); + let mut rng = rand_chacha::ChaChaRng::from_os_rng(); // Fill the secret key & salt with random bytes: rng.fill_bytes(&mut secret_key);