Skip to content
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

Merged
merged 1 commit into from Oct 15, 2021
Merged

redox: Switch to /dev/urandom #222

merged 1 commit into from Oct 15, 2021

Conversation

josephlr
Copy link
Member

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

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]
Copy link
Member Author

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

Copy link
Member

@newpavlov newpavlov Aug 14, 2021

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.

Copy link
Member Author

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?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@josephlr not really

@jackpot51
Copy link

/dev/urandom is now a symlink to rand:, and rand: is always a non-blocking CPRNG

Copy link
Member

@newpavlov newpavlov left a 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.

@jackpot51
Copy link

@newpavlov rand: (and /dev/urandom with it being a symlink) will not return any data until it is initialized. It will block on read.

@josephlr josephlr merged commit e4004f4 into master Oct 15, 2021
@josephlr josephlr deleted the redox branch October 15, 2021 01:16
@jackpot51
Copy link

Thanks @josephlr !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants