Skip to content

Commit e4004f4

Browse files
authored
redox: Switch to /dev/urandom (#222)
Signed-off-by: Joe Richey <[email protected]>
1 parent 30308ae commit e4004f4

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

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: 1 addition & 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,7 @@ 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(target_os = "android", target_os = "linux", target_os = "redox"))]
3230
const FILE_PATH: &str = "/dev/urandom\0";
3331

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

0 commit comments

Comments
 (0)