Closed speakeasypuncture closed 6 years ago
Thanks for summarizing, but I don't think that captures the point. We are not advocating for reimplementing something that's in a library (for whatever reason), but for removing the library entirely. The library implements a user-space CSPRNG on top of kernel entropy, it might be good or bad, doesn't matter, we are arguing for not using one at all.
What you say is valid about primitives, which have to be implemented somewhere, but here we are talking about removing a layer from a system, where each layer is an independent point of failure.
As for "they are the ones that know about security", OpenSSL is bound by a lot of legacy, BoringSSL and libsodium are widely regarded as secure modern implementations, and those use the kernel CSPRNG.
@FiloSottile Thanks, I've amended my post. Holler if you're still unhappy with my representations.
What's the current status with this issue?
@atoponce I could well have made a mistake somewhere, but tracing randomBytes appears to land here:
In which we first call RAND_status and then RAND_byes, these being OpenSSL functions.
randomBytes uses OpenSSL as its random number generator. It would be wiser and less errorprone to use a system RNG like urandom on Unix platforms, getrandom syscall on Linux and CryptGenRandom on Windows.