3 ms·
Let me put it plainly -- system configuration can affect /dev/random in ways that do not affect /dev/urandom. As a result, organizational or contractual requir
by binarycrusader 10y ago
Let me put it plainly -- system configuration can affect /dev/random in ways that do not affect /dev/urandom.
As a result, organizational or contractual requirements that a system administrator may have are only guaranteed to be met when using /dev/random.
This system configuration is specific to Solaris, which is why Solaris is different than Linux.
- tptacek 10y agoSee, the problem with this is that you haven't put it plainly. I understand how CSPRNGs work. I understand a lot about how Linux's works, and a little bit about how Solaris's works. My sense is that if there's an argument about how Solaris urandom is inferior, I should be able to understand what it is. What is it? I'm becoming increasingly convinced that there is no difference between the urandom story on Linux and the urandom story on Solaris. Not that the generators are the same, but that the differences simply do not matter. If you don't know the specific answer, could you get one of your friends on the team to chime in? I'm reaching a threshold at which I'm going to start noisily telling people that urandom on Solaris is fine --- incidentally, a lot of very well-regarded software already agrees with me, so I feel reasonably safe joining the chorus.
- binarycrusader 10y agoI have personally verified that the documentation and guidance in Solaris is up to date and correct per the authors. As I said before, and I as I will say again, the differences do matter for some administrators with specific contractual and/or other obligations and when generating "high value" keying material. If you choose to advise others contrary to the documented guidance that Solaris provides, that is your choice.
- tptacek 10y agoI've just read through the Illumos code, and for Illumos at least, urandom actually seems less scary: there's a direct code path in /dev/random that reads raw entropy bytes (like thread timing) and returns it to callers, but the urandom path always goes through fips_random_inner() or equivalent. Always use urandom. If your contracts require you not to, revise your contracts, not your code.
- binarycrusader 10y agoThe illumos code is more than five years diverged from Solaris. It is no longer a point of valid comparison for some subsystems such as crypto. Use of urandom contrary to official guidance is not recommended.
- tptacek 10y agoUnless Solaris regressed its urandom, the difference is immaterial.
- ekiru 10y agoThe reason tptacek looked at the illumos source code is because I mentioned to them that a blog post you've previously linked to about the Solaris random devices [1] appeared [2] to suggest that the entropy provided by KCF randomness providers is given out fairly directly by /dev/random (with each byte of entropy XORed with the byte returned 1024 bytes earlier). Do you know if that specific thing has been changed to stop being true since illumos diverged? Do you know if urandom has been changed to no longer always run things through fips_random_inner (as illumos does and Darren Moffat's blog post says Solaris does)? [Edited to add: it looks as though the tweeting questions-at Darren Moffat protocol has been initiated: https://twitter.com/tqbf/status/817496091759362048 https://twitter.com/tqbf/status/817496091759362048 . It's also worth noting (which I failed to do previously) that two of the three random providers in the blog post are described as doing their own hashing/similar processing of the entropy bytes they provide to the random pool, and the other one appears to do so from the illumos source.] > Use of urandom contrary to official guidance is not recommended. This is, I think, a case where using the passive voice is suboptimal. The official guidance obviously does not recommend using urandom contrary to official guidance, nor do you. Some others do recommend it, as this whole argument shows. More substantively, this is the part of your stance that would be, as tptacek previously suggested, equally applicable to Linux urandom prior to Linux fixing their man pages. At that time, the official guidance on urandom was that it was inferior to random in general instead of solely in the one specific case of requests before the kernel CSPRNG has been seeded. If the official guidance is incorrect about when and if urandom is inferior to random, then use of urandom contrary to official guidance should be recommended. [1]: https://blogs.oracle.com/darren/entry/solaris_random_number_generation https://blogs.oracle.com/darren/entry/solaris_random_number_... [2]: The blog post only briefly mentions the rndc_addbytes and rndc_getbytes functions where the entropy provision and randomness-extraction bottom out, so it is possible that it just omits the details of any additional processing performed at that level. But it at least does not mention any further processing performed on the bytes from KCF providers except in FIPS mode.