New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
redox: Switch to /dev/urandom #222
Conversation
Signed-off-by: Joe Richey <joerichey@google.com>
@@ -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] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may need to update the documentation link here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The link simply points to the relevant Redox source code. It would be nice to replace it with a proper documentation link, but AFAIK such documentation currently does not exist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jackpot51 does Redox have any docs describing either rand:
or /dev/urandom
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@josephlr not really
/dev/urandom is now a symlink to rand:, and rand: is always a non-blocking CPRNG |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIUC /dev/urandom
was added mostly for compatibility purposes and reading rand:
is more idiomatic. From practical point of view both options are equivalent to each other, so I am fine with this change.
@jackpot51
BTW how Redox handles entropy pool initialization on system startup? The preferred behavior for us would be for it to block rand:
/dev/urandom
reading until the pool gets properly initialized.
@newpavlov rand: (and /dev/urandom with it being a symlink) will not return any data until it is initialized. It will block on read. |
Thanks @josephlr ! |
From briansmith/ring#1341 apparently on Redox the
/dev/urandom
device now exists. Changing the implementation for consistency between RNG crates.@jackpot51 does this look good to you? Also, where is this device documented?
Signed-off-by: Joe Richey joerichey@google.com