From 095d2780e8b53e5418103d2abc4420a4253152b7 Mon Sep 17 00:00:00 2001 From: Tom Prince Date: Sun, 8 Jan 2017 16:37:54 -0700 Subject: [PATCH 1/2] Add a note about `OsRng` blocking in early init. --- src/os.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/os.rs b/src/os.rs index e9ab758ee17..c0010fb83f5 100644 --- a/src/os.rs +++ b/src/os.rs @@ -26,7 +26,9 @@ use Rng; /// - iOS: calls SecRandomCopyBytes as /dev/(u)random is sandboxed. /// - PNaCl: calls into the `nacl-irt-random-0.1` IRT interface. /// -/// This does not block. +/// This usually does not block. On some systems (e.g. FreeBSD, OpenBSD, +/// Max OS X, and modern Linux) this may block very early in the init +/// process, if the CSPRNG has not seeded yet. pub struct OsRng(imp::OsRng); impl OsRng { From c3fb2f642fbb867e001eac4371b390b934301e13 Mon Sep 17 00:00:00 2001 From: Tom Prince Date: Thu, 2 Feb 2017 19:48:54 -0700 Subject: [PATCH 2/2] Add some notes. --- src/os.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/os.rs b/src/os.rs index c0010fb83f5..8ee36062f3f 100644 --- a/src/os.rs +++ b/src/os.rs @@ -28,7 +28,10 @@ use Rng; /// /// This usually does not block. On some systems (e.g. FreeBSD, OpenBSD, /// Max OS X, and modern Linux) this may block very early in the init -/// process, if the CSPRNG has not seeded yet. +/// process, if the CSPRNG has not been seeded yet.[1] +/// +/// [1] See https://www.python.org/dev/peps/pep-0524/ for a more in-depth +/// discussion. pub struct OsRng(imp::OsRng); impl OsRng {