From d55009c59458c5fe8520f8cd10e8b61696ebab7a Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Mon, 4 Oct 2021 23:55:52 +0200 Subject: [PATCH] crypto/rand: document additional getrandom/getentropy support in Reader CL 269999 added support for getrandom on Dragonfly. CL 299134 added support for getrandom on Solaris. CL 302489 added support for getentropy on macOS. Update the godoc for Reader accordingly. Change-Id: Ice39e5e62f052f21b664db6abbfd97f03944586e Reviewed-on: https://go-review.googlesource.com/c/go/+/353190 Trust: Tobias Klauser Run-TryBot: Tobias Klauser TryBot-Result: Go Bot Reviewed-by: Ian Lance Taylor --- src/crypto/rand/rand.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/crypto/rand/rand.go b/src/crypto/rand/rand.go index fddd1147e6..b6248a4438 100644 --- a/src/crypto/rand/rand.go +++ b/src/crypto/rand/rand.go @@ -11,8 +11,9 @@ import "io" // Reader is a global, shared instance of a cryptographically // secure random number generator. // -// On Linux and FreeBSD, Reader uses getrandom(2) if available, /dev/urandom otherwise. -// On OpenBSD, Reader uses getentropy(2). +// On Linux, FreeBSD, Dragonfly and Solaris, Reader uses getrandom(2) if +// available, /dev/urandom otherwise. +// On OpenBSD and macOS, Reader uses getentropy(2). // On other Unix-like systems, Reader reads from /dev/urandom. // On Windows systems, Reader uses the RtlGenRandom API. // On Wasm, Reader uses the Web Crypto API. -- 2.48.1