]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.21] crypto/rand,runtime: switch RtlGenRandom for ProcessPrng
authorRoland Shoemaker <roland@golang.org>
Wed, 18 Oct 2023 15:25:08 +0000 (11:25 -0400)
committerGopher Robot <gobot@golang.org>
Tue, 28 Nov 2023 17:48:47 +0000 (17:48 +0000)
commit9e43850a3298a9b8b1162ba0033d4c53f8637571
tree4b29a17c2321ff515ccc3f719a265a9e86d8b078
parent8caf4bb3e78d0bc2d5598645b89ed8f0e9bd68f2
[release-branch.go1.21] crypto/rand,runtime: switch RtlGenRandom for ProcessPrng

RtlGenRandom is a semi-undocumented API, also known as
SystemFunction036, which we use to generate random data on Windows.
It's definition, in cryptbase.dll, is an opaque wrapper for the
documented API ProcessPrng. Instead of using RtlGenRandom, switch to
using ProcessPrng, since the former is simply a wrapper for the latter,
there should be no practical change on the user side, other than a minor
change in the DLLs we load.

Updates #53192
Fixes #64413

Change-Id: Ie6891bf97b1d47f5368cccbe92f374dba2c2672a
Reviewed-on: https://go-review.googlesource.com/c/go/+/536235
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Quim Muntal <quimmuntal@gmail.com>
Auto-Submit: Roland Shoemaker <roland@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
(cherry picked from commit 693def151adff1af707d82d28f55dba81ceb08e1)
Reviewed-on: https://go-review.googlesource.com/c/go/+/545355
Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
src/crypto/rand/rand.go
src/crypto/rand/rand_windows.go
src/internal/syscall/windows/syscall_windows.go
src/internal/syscall/windows/zsyscall_windows.go
src/runtime/os_windows.go