-
Notifications
You must be signed in to change notification settings - Fork 771
Description
The main drivers here are performance and the ability to work correctly and automatically in a chroot/jail.
This was split off from #316, which is now OpenBSD-only. Note that iOS and MacOS are issue #149.
See:
- Replace
/dev/urandom
usage on OpenBSD #316 (comment) - Replace
/dev/urandom
usage on OpenBSD #316 (comment), which among other things references https://paragonie.com/blog/2016/05/how-generate-secure-random-numbers-in-various-programming-languages. - What LibreSSL does and why.
- What libsodium does and why.
- CVE-2014-2970
- https://lists.freebsd.org/pipermail/freebsd-security/2014-July/007849.html
- https://lists.freebsd.org/pipermail/freebsd-security/2014-July/007853.html
- https://lists.freebsd.org/pipermail/freebsd-security/2014-July/007868.html
From reading various FreeBSD mailing list messages, it seems like FreeBSD doesn't have a good way to guarantee fork-safety, which is the same problem that Linux has. Therefore, it seems like we should always be getting random values from the OS. That means, AFAICT, either reading from /dev/[u]random
or the KERN_ARND
sysctl
. Note the potential problems with KERN_ARND
mentioned in the linked-to comments above.
I don't understand this issue fully, but it seems that FreeBSD has a RANDOM kernel module that can be disabled, and in that disabled state it may be problematic to do anything better than reading from /dev/[u]random
: "RW mentioned kernels without RANDOM, being an awkward situation for which it seems necessary to fall back to the PRNG in userland." - https://lists.freebsd.org/pipermail/freebsd-security/2014-July/007869.html.