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);