Skip to content

Commit

Permalink
redox: Switch to /dev/urandom (#222)
Browse files Browse the repository at this point in the history
Signed-off-by: Joe Richey <joerichey@google.com>
  • Loading branch information
josephlr committed Oct 15, 2021
1 parent 30308ae commit e4004f4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/lib.rs
Expand Up @@ -22,7 +22,7 @@
//! | Dragonfly BSD | `*‑dragonfly` | [`getrandom()`][22] if available, otherwise [`/dev/random`][8]
//! | Solaris, illumos | `*‑solaris`, `*‑illumos` | [`getrandom()`][9] if available, otherwise [`/dev/random`][10]
//! | Fuchsia OS | `*‑fuchsia` | [`cprng_draw`][11]
//! | Redox | `*‑redox` | [`rand:`][12]
//! | Redox | `*‑redox` | [`/dev/urandom`][12]
//! | Haiku | `*‑haiku` | `/dev/random` (identical to `/dev/urandom`)
//! | SGX | `x86_64‑*‑sgx` | [RDRAND][18]
//! | VxWorks | `*‑wrs‑vxworks‑*` | `randABytes` after checking entropy pool initialization with `randSecure`
Expand Down
4 changes: 1 addition & 3 deletions src/use_file.rs
Expand Up @@ -17,8 +17,6 @@ use core::{
sync::atomic::{AtomicUsize, Ordering::Relaxed},
};

#[cfg(target_os = "redox")]
const FILE_PATH: &str = "rand:\0";
#[cfg(any(
target_os = "dragonfly",
target_os = "emscripten",
Expand All @@ -28,7 +26,7 @@ const FILE_PATH: &str = "rand:\0";
target_os = "illumos"
))]
const FILE_PATH: &str = "/dev/random\0";
#[cfg(any(target_os = "android", target_os = "linux"))]
#[cfg(any(target_os = "android", target_os = "linux", target_os = "redox"))]
const FILE_PATH: &str = "/dev/urandom\0";

pub fn getrandom_inner(dest: &mut [u8]) -> Result<(), Error> {
Expand Down

0 comments on commit e4004f4

Please sign in to comment.