From 644628536f248cf3d5c977ed49abe51243d69ae6 Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Mon, 4 Nov 2024 12:56:04 +0100 Subject: 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 Reviewed-by: Roland Shoemaker LUCI-TryBot-Result: Go LUCI Auto-Submit: Filippo Valsorda Reviewed-by: Dmitri Shuralyov --- src/runtime/panic.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/runtime/panic.go') diff --git a/src/runtime/panic.go b/src/runtime/panic.go index 7447854989..8e8ee8559a 100644 --- a/src/runtime/panic.go +++ b/src/runtime/panic.go @@ -1038,6 +1038,11 @@ func rand_fatal(s string) { fatal(s) } +//go:linkname sysrand_fatal crypto/internal/sysrand.fatal +func sysrand_fatal(s string) { + fatal(s) +} + //go:linkname fips_fatal crypto/internal/fips.fatal func fips_fatal(s string) { fatal(s) -- cgit v1.3-5-g9baa