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

Possible improvements to OsRng #332

Closed
2 of 4 tasks
pitdicker opened this issue Mar 25, 2018 · 0 comments
Closed
2 of 4 tasks

Possible improvements to OsRng #332

pitdicker opened this issue Mar 25, 2018 · 0 comments
Labels
F-new-int Functionality: new, within Rand P-low Priority: Low

Comments

@pitdicker
Copy link
Contributor

pitdicker commented Mar 25, 2018

Let me first link to this post I wrote a while ago around the OS interfaces to OsRng and error handling. A half year has passed, and I think we are in a pretty good shape now.

Only four things left:

  • We do not yet support the getrandom syscall on Solaris.
  • We are not using the syscall interface on Linux on all platforms yet. I think NR_GETRANDOM for powerpc is 359, instead of the 384 we use now, but I'm not sure. And for s390x it may be 349.
  • On old Linux versions, NetBSD and possibly others, first try reading from /dev/random with O_NONBLOCK so we know the system is properly seeded, and only then open /dev/urandom (the preferred random device). This prevents us reading from the OS RNG while it is not yet properly seeded, which may happen very early in the boot process on for example virtual machines, which /dev/urandom does not prevent.
  • Do we want to provide some future that reports when the OS RNG is ready? If I remember right, on Linux, Solaris and NetBSD /dev/random and getrandom can return an error if it is not yet seeded. It is then possible to poll on /dev/random and be notified when it becomes available.
@pitdicker pitdicker mentioned this issue Mar 25, 2018
@dhardy dhardy added X-enhancement F-new-int Functionality: new, within Rand labels Mar 26, 2018
@pitdicker pitdicker added P-low Priority: Low and removed P-medium labels Mar 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-new-int Functionality: new, within Rand P-low Priority: Low
Projects
None yet
Development

No branches or pull requests

2 participants