| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
|
|
This is required due to `BCryptGenRandom` failing to load the necessary dll on some systems.
|
|
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.
|
|
|
|
|
|
Also briefly document the history of `sys/windows/rand.rs` as they may be relevant to any future changes.
|
|
|
|
|
|
|
|
|
|
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
|
|
BCryptGenRandom isn't available on XP, but we dropped XP support a while
ago.
|
|
|