summaryrefslogtreecommitdiff
path: root/src/crypto
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2021-01-15 00:04:10 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2021-01-15 18:42:27 +0000
commitbb5075a5259baeaa75f09db64c3860c5876a00fd (patch)
tree0f31dc5cf749817f6796a7ea70886cd040342796 /src/crypto
parent1deae0b59747ea87d0ef02b6dfdfbbdf5e7bcee8 (diff)
downloadgo-git-bb5075a5259baeaa75f09db64c3860c5876a00fd.tar.gz
syscall: remove RtlGenRandom and move it into internal/syscall
There's on need to expose this to the frozen syscall package, and it also doesn't need to be unsafe. So we move it into internal/syscall and have the generator make a safer function signature. Fixes #43704. Change-Id: Iccae69dc273a0aa97ee6846eb537f1dc1412f2de Reviewed-on: https://go-review.googlesource.com/c/go/+/283992 Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Austin Clements <austin@google.com> Trust: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/crypto')
-rw-r--r--src/crypto/rand/rand_windows.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/crypto/rand/rand_windows.go b/src/crypto/rand/rand_windows.go
index 8b2c960906..7379f1489a 100644
--- a/src/crypto/rand/rand_windows.go
+++ b/src/crypto/rand/rand_windows.go
@@ -8,8 +8,8 @@
package rand
import (
+ "internal/syscall/windows"
"os"
- "syscall"
)
func init() { Reader = &rngReader{} }
@@ -24,7 +24,7 @@ func (r *rngReader) Read(b []byte) (n int, err error) {
return 0, nil
}
- err = syscall.RtlGenRandom(&b[0], inputLen)
+ err = windows.RtlGenRandom(b)
if err != nil {
return 0, os.NewSyscallError("RtlGenRandom", err)
}