]> Cypherpunks.ru repositories - gostls13.git/commit
[release-branch.go1.20] 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:50 +0000 (17:48 +0000)
commit1bd76576fec9c23a2de3bd282ff9b1c0ba117c50
tree160ada62d629433cf7767df418cf844822dc6573
parent1b59b017db1ac4a63ed08173c00d7f08d47530be
[release-branch.go1.20] 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 #64412

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/+/545356
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