aboutsummaryrefslogtreecommitdiff
path: root/src/syscall
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/syscall
parent1deae0b59747ea87d0ef02b6dfdfbbdf5e7bcee8 (diff)
downloadgo-bb5075a5259baeaa75f09db64c3860c5876a00fd.tar.gz
go-bb5075a5259baeaa75f09db64c3860c5876a00fd.zip
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/syscall')
-rw-r--r--src/syscall/syscall_windows.go1
-rw-r--r--src/syscall/zsyscall_windows.go9
2 files changed, 0 insertions, 10 deletions
diff --git a/src/syscall/syscall_windows.go b/src/syscall/syscall_windows.go
index c1a12ccba3..ba69133d81 100644
--- a/src/syscall/syscall_windows.go
+++ b/src/syscall/syscall_windows.go
@@ -234,7 +234,6 @@ func NewCallbackCDecl(fn interface{}) uintptr {
//sys CryptAcquireContext(provhandle *Handle, container *uint16, provider *uint16, provtype uint32, flags uint32) (err error) = advapi32.CryptAcquireContextW
//sys CryptReleaseContext(provhandle Handle, flags uint32) (err error) = advapi32.CryptReleaseContext
//sys CryptGenRandom(provhandle Handle, buflen uint32, buf *byte) (err error) = advapi32.CryptGenRandom
-//sys RtlGenRandom(buf *uint8, bytes uint32) (err error) = advapi32.SystemFunction036
//sys GetEnvironmentStrings() (envs *uint16, err error) [failretval==nil] = kernel32.GetEnvironmentStringsW
//sys FreeEnvironmentStrings(envs *uint16) (err error) = kernel32.FreeEnvironmentStringsW
//sys GetEnvironmentVariable(name *uint16, buffer *uint16, size uint32) (n uint32, err error) = kernel32.GetEnvironmentVariableW
diff --git a/src/syscall/zsyscall_windows.go b/src/syscall/zsyscall_windows.go
index 86c4cac2ad..2166be595b 100644
--- a/src/syscall/zsyscall_windows.go
+++ b/src/syscall/zsyscall_windows.go
@@ -65,7 +65,6 @@ var (
procRegOpenKeyExW = modadvapi32.NewProc("RegOpenKeyExW")
procRegQueryInfoKeyW = modadvapi32.NewProc("RegQueryInfoKeyW")
procRegQueryValueExW = modadvapi32.NewProc("RegQueryValueExW")
- procSystemFunction036 = modadvapi32.NewProc("SystemFunction036")
procCertAddCertificateContextToStore = modcrypt32.NewProc("CertAddCertificateContextToStore")
procCertCloseStore = modcrypt32.NewProc("CertCloseStore")
procCertCreateCertificateContext = modcrypt32.NewProc("CertCreateCertificateContext")
@@ -333,14 +332,6 @@ func RegQueryValueEx(key Handle, name *uint16, reserved *uint32, valtype *uint32
return
}
-func RtlGenRandom(buf *uint8, bytes uint32) (err error) {
- r1, _, e1 := Syscall(procSystemFunction036.Addr(), 2, uintptr(unsafe.Pointer(buf)), uintptr(bytes), 0)
- if r1 == 0 {
- err = errnoErr(e1)
- }
- return
-}
-
func CertAddCertificateContextToStore(store Handle, certContext *CertContext, addDisposition uint32, storeContext **CertContext) (err error) {
r1, _, e1 := Syscall6(procCertAddCertificateContextToStore.Addr(), 4, uintptr(store), uintptr(unsafe.Pointer(certContext)), uintptr(addDisposition), uintptr(unsafe.Pointer(storeContext)), 0, 0)
if r1 == 0 {