]> Cypherpunks repositories - gostls13.git/commit
crypto/rand: move OS interaction to crypto/internal/sysrand
authorFilippo Valsorda <filippo@golang.org>
Mon, 4 Nov 2024 11:56:04 +0000 (12:56 +0100)
committerGopher Robot <gobot@golang.org>
Tue, 19 Nov 2024 00:29:28 +0000 (00:29 +0000)
commit644628536f248cf3d5c977ed49abe51243d69ae6
treef5a6ebcb021bcd184954b6c7232db341748605f5
parentf705cf8f96bef3f61ba65e62b0b9123d718d0d12
crypto/rand: move OS interaction to crypto/internal/sysrand

We're going to use that package as the passive entropy source for the
FIPS module, and we need to import it from a package that will be
imported by crypto/rand.

Since there is no overridable Reader now, introduced a mechanism to test
the otherwise impossible failure of the OS entropy source.

For #69536

Change-Id: I558687ed1ec896dba05b99b937970bb809de3fe7
Reviewed-on: https://go-review.googlesource.com/c/go/+/624976
Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
Reviewed-by: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
17 files changed:
src/crypto/internal/sysrand/internal/seccomp/seccomp_linux.go [moved from src/crypto/rand/internal/seccomp/seccomp_linux.go with 100% similarity]
src/crypto/internal/sysrand/internal/seccomp/seccomp_unsupported.go [moved from src/crypto/rand/internal/seccomp/seccomp_unsupported.go with 100% similarity]
src/crypto/internal/sysrand/rand.go [new file with mode: 0644]
src/crypto/internal/sysrand/rand_aix.go [moved from src/crypto/rand/rand_aix.go with 93% similarity]
src/crypto/internal/sysrand/rand_arc4random.go [moved from src/crypto/rand/rand_arc4random.go with 97% similarity]
src/crypto/internal/sysrand/rand_getrandom.go [moved from src/crypto/rand/rand_getrandom.go with 99% similarity]
src/crypto/internal/sysrand/rand_js.go [moved from src/crypto/rand/rand_js.go with 97% similarity]
src/crypto/internal/sysrand/rand_linux_test.go [moved from src/crypto/rand/rand_linux_test.go with 95% similarity]
src/crypto/internal/sysrand/rand_netbsd.go [moved from src/crypto/rand/rand_netbsd.go with 97% similarity]
src/crypto/internal/sysrand/rand_plan9.go [moved from src/crypto/rand/rand_plan9.go with 98% similarity]
src/crypto/internal/sysrand/rand_test.go [new file with mode: 0644]
src/crypto/internal/sysrand/rand_wasip1.go [moved from src/crypto/rand/rand_wasip1.go with 97% similarity]
src/crypto/internal/sysrand/rand_windows.go [moved from src/crypto/rand/rand_windows.go with 94% similarity]
src/crypto/rand/rand.go
src/crypto/rand/rand_test.go
src/go/build/deps_test.go
src/runtime/panic.go