about summary refs log tree commit diff
path: root/library/std/src/sys/windows/rand.rs
AgeCommit message (Collapse)AuthorLines
2024-01-11std: begin moving platform support modules into `pal`joboet-42/+0
2023-06-10Lazy load ntdll functions on UWPbdbai-2/+3
2023-05-05Use new bindingsChris Denton-2/+4
2023-02-14Revert to using `RtlGenRandom`Chris Denton-94/+27
This is required due to `BCryptGenRandom` failing to load the necessary dll on some systems.
2022-09-20Remove `RtlGenRandom` (take two)Chris Denton-48/+28
First try to use the system preferred RNG but if that fails (e.g. due to a broken system configuration) then fallback to manually opening an algorithm handle.
2022-09-07Don't break windows/rand for miriChris Denton-0/+12
2022-09-06Open a BCrypt algorithm handleChris Denton-18/+64
2022-09-02Use `BCRYPT_RNG_ALG_HANDLE` by defaultChris Denton-4/+37
Also briefly document the history of `sys/windows/rand.rs` as they may be relevant to any future changes.
2022-07-17Simplify Windows `hashmap_random_keys`Chris Denton-60/+8
2022-06-16Move/rename `lazy::Sync{OnceCell,Lazy}` to `sync::{Once,Lazy}Lock`Maybe Waffle-2/+2
2022-05-16Improve error message for fallback RNG failureChris Martin-1/+1
2022-05-13Address review feedbackChris Martin-31/+22
2022-05-10Make HashMap fall back to RtlGenRandom if BCryptGenRandom failsChris Martin-4/+79
Issue #84096 changed the hashmap RNG to use BCryptGenRandom instead of RtlGenRandom on Windows. Mozilla Firefox started experiencing random failures in env_logger::Builder::new() (Issue #94098) during initialization of their unsandboxed main process with an "Access Denied" error message from BCryptGenRandom(), which is used by the HashMap contained in env_logger::Builder The root cause appears to be a virus scanner or other software interfering with BCrypt DLLs loading. This change adds a fallback option if BCryptGenRandom is unusable for whatever reason. It will fallback to RtlGenRandom in this case. Fixes #94098
2021-10-15Use BCryptGenRandom instead of RtlGenRandom on Windows.Mara Bos-12/+0
BCryptGenRandom isn't available on XP, but we dropped XP support a while ago.
2020-07-27mv std libs to library/mark-0/+33