Skip to content

Commit 48cbd3e

Browse files
committed
redox: Switch to /dev/urandom
Signed-off-by: Joe Richey <joerichey@google.com>
1 parent 30308ae commit 48cbd3e

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
//! | Dragonfly BSD | `*‑dragonfly` | [`getrandom()`][22] if available, otherwise [`/dev/random`][8]
2323
//! | Solaris, illumos | `*‑solaris`, `*‑illumos` | [`getrandom()`][9] if available, otherwise [`/dev/random`][10]
2424
//! | Fuchsia OS | `*‑fuchsia` | [`cprng_draw`][11]
25-
//! | Redox | `*‑redox` | [`rand:`][12]
25+
//! | Redox | `*‑redox` | [`/dev/urandom`][12]
2626
//! | Haiku | `*‑haiku` | `/dev/random` (identical to `/dev/urandom`)
2727
//! | SGX | `x86_64‑*‑sgx` | [RDRAND][18]
2828
//! | VxWorks | `*‑wrs‑vxworks‑*` | `randABytes` after checking entropy pool initialization with `randSecure`

src/use_file.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ use core::{
1717
sync::atomic::{AtomicUsize, Ordering::Relaxed},
1818
};
1919

20-
#[cfg(target_os = "redox")]
21-
const FILE_PATH: &str = "rand:\0";
2220
#[cfg(any(
2321
target_os = "dragonfly",
2422
target_os = "emscripten",
@@ -28,7 +26,11 @@ const FILE_PATH: &str = "rand:\0";
2826
target_os = "illumos"
2927
))]
3028
const FILE_PATH: &str = "/dev/random\0";
31-
#[cfg(any(target_os = "android", target_os = "linux"))]
29+
#[cfg(any(
30+
target_os = "android",
31+
target_os = "linux",
32+
target_os = "redox"
33+
))]
3234
const FILE_PATH: &str = "/dev/urandom\0";
3335

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

0 commit comments

Comments
 (0)