1
0
mirror of https://github.com/golang/go synced 2024-11-17 14:14:56 -07:00
go/src/syscall
Jason A. Donenfeld be9379f8a8 syscall: correct CertOpenStore to expect a 0 return value on failure
According to [1], this function returns NULL when it errors, rather than
INVALID_HANDLE_VALUE, which other Win32 functions return. This was
pointed out in CL 273446 for the x/sys package, and this patch here
cleans it up for the syscall package and updates the vendored x/sys
package using the usual `go get/go mod vendor` dance. The function is
currently in use by crypto/x509/root_windows.go, which calls
CertOpenStore(CERT_STORE_PROV_MEMORY), which I assume can fail under OOM
or other weird conditions. Quick reversing indicates that [1] is
correct, as there's a `xor eax, eax` in the error paths of the function
just before jumping to the epilogue.

[1] https://docs.microsoft.com/en-us/windows/win32/api/wincrypt/nf-wincrypt-certopenstore#return-value

Change-Id: I77c0b0319c13313212f8710785252c494da56ed5
Reviewed-on: https://go-review.googlesource.com/c/go/+/273827
Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Trust: Jason A. Donenfeld <Jason@zx2c4.com>
Trust: Alex Brainman <alex.brainman@gmail.com>
2020-12-05 12:36:42 +00:00
..
js
asm9_unix1_amd64.s
asm9_unix2_amd64.s
asm_aix_ppc64.s
asm_darwin_amd64.s
asm_darwin_arm64.s
asm_freebsd_arm64.s
asm_freebsd_arm.s
asm_linux_386.s
asm_linux_amd64.s runtime: don't crash if vsyscall and vdso are disabled on x86_64 2020-09-30 05:39:59 +00:00
asm_linux_arm64.s
asm_linux_arm.s
asm_linux_mips64x.s
asm_linux_mipsx.s
asm_linux_ppc64x.s
asm_linux_riscv64.s
asm_linux_s390x.s
asm_netbsd_arm64.s
asm_netbsd_arm.s
asm_openbsd_arm64.s
asm_openbsd_arm.s
asm_openbsd_mips64.s syscall: add support for openbsd/mips64 2020-10-29 08:08:26 +00:00
asm_plan9_386.s
asm_plan9_amd64.s
asm_plan9_arm.s
asm_solaris_amd64.s
asm_unix_386.s
asm_unix_amd64.s
asm_windows.s
bpf_bsd.go
bpf_darwin.go
const_plan9.go
creds_test.go
dir_plan9.go
dirent_test.go
dirent.go
dll_windows.go syscall: add DLLError.Unwrap function 2020-11-21 07:37:02 +00:00
endian_big.go
endian_little.go
env_unix.go
env_windows.go
errors_plan9.go
exec_aix_test.go
exec_bsd.go syscall: use correct type for TIOCSPGRP/TIOCGPGRP 2020-11-13 13:56:34 +00:00
exec_darwin.go
exec_libc.go
exec_linux_test.go
exec_linux.go
exec_plan9.go
exec_solaris_test.go
exec_unix_test.go syscall: use correct type for TIOCSPGRP/TIOCGPGRP 2020-11-13 13:56:34 +00:00
exec_unix.go all: add GOOS=ios 2020-09-23 18:12:59 +00:00
exec_windows_test.go syscall: restore EscapeArg behavior for empty string 2020-10-08 20:46:25 +00:00
exec_windows.go syscall: expose bInheritHandles of CreateProcess 2020-11-05 02:28:14 +00:00
export_darwin_test.go syscall: use libc-based ioctl for Ioctl in tests on darwin 2020-09-22 18:05:58 +00:00
export_freebsd_test.go
export_linux_test.go
export_test.go
export_unix_test.go syscall: use libc-based ioctl for Ioctl in tests on darwin 2020-09-22 18:05:58 +00:00
flock_aix.go
flock_darwin.go
flock_linux_32bit.go
flock.go
forkpipe2.go
forkpipe.go
fs_js.go syscall: remove dependency on io 2020-10-13 00:55:35 +00:00
getdirentries_test.go
lsf_linux.go
mkall.sh syscall: add support for openbsd/mips64 2020-10-29 08:08:26 +00:00
mkasm_darwin.go
mkerrors.sh
mkpost.go all: update references to symbols moved from io/ioutil to io 2020-10-20 18:41:18 +00:00
mksyscall_libc.pl
mksyscall_windows.go syscall: switch go:generate directives back to mksyscall_windows.go 2020-11-02 15:31:49 +00:00
mksyscall.pl
mksysctl_openbsd.pl
mksysnum_dragonfly.pl
mksysnum_freebsd.pl
mksysnum_linux.pl
mksysnum_netbsd.pl
mksysnum_openbsd.pl syscall: add support for openbsd/mips64 2020-10-29 08:08:26 +00:00
mksysnum_plan9.sh
mmap_unix_test.go
msan0.go
msan.go
net_js.go
net.go
netlink_linux.go
pwd_plan9.go
route_bsd.go
route_darwin.go
route_dragonfly.go
route_freebsd_32bit.go
route_freebsd_64bit.go
route_freebsd.go
route_netbsd.go
route_openbsd.go
security_windows.go
setuidgid_32_linux.go syscall: support POSIX semantics for Linux syscalls 2020-10-23 20:53:14 +00:00
setuidgid_linux.go syscall: support POSIX semantics for Linux syscalls 2020-10-23 20:53:14 +00:00
sock_cloexec_linux.go
sockcmsg_dragonfly.go
sockcmsg_linux.go
sockcmsg_unix_other.go syscall: use correct cmsg alignment for netbsd/arm64 2020-10-01 13:23:43 +00:00
sockcmsg_unix.go
str.go
syscall_aix_ppc64.go
syscall_aix.go syscall, cmd/go/internal/modload: add and use Access on aix 2020-10-20 07:33:13 +00:00
syscall_bsd_test.go
syscall_bsd.go syscall: implement Getwd using getcwd from libSystem on darwin 2020-09-26 10:09:33 +00:00
syscall_darwin_amd64.go
syscall_darwin_arm64.go syscall: support ptrace on macOS/ARM64 2020-10-08 23:14:40 +00:00
syscall_darwin.go syscall: implement Getwd using getcwd from libSystem on darwin 2020-09-26 10:09:33 +00:00
syscall_dragonfly_amd64.go
syscall_dragonfly.go
syscall_dup2_linux.go
syscall_dup3_linux.go
syscall_freebsd_386.go
syscall_freebsd_amd64.go
syscall_freebsd_arm64.go
syscall_freebsd_arm.go
syscall_freebsd_test.go
syscall_freebsd.go
syscall_illumos.go internal/poll, net, syscall: use accept4 on illumos 2020-10-16 19:53:34 +00:00
syscall_js.go all: update references to symbols moved from os to io/fs 2020-10-20 02:32:42 +00:00
syscall_linux_386.go syscall: handle undefined r2 value on linux-ppc64x 2020-10-29 17:53:57 +00:00
syscall_linux_amd64.go syscall: handle undefined r2 value on linux-ppc64x 2020-10-29 17:53:57 +00:00
syscall_linux_arm64.go syscall: handle undefined r2 value on linux-ppc64x 2020-10-29 17:53:57 +00:00
syscall_linux_arm.go syscall: handle undefined r2 value on linux-ppc64x 2020-10-29 17:53:57 +00:00
syscall_linux_mips64x.go syscall: handle undefined r2 value on linux-ppc64x 2020-10-29 17:53:57 +00:00
syscall_linux_mipsx.go syscall: handle undefined r2 value on linux-ppc64x 2020-10-29 17:53:57 +00:00
syscall_linux_ppc64x.go syscall: handle undefined r2 value on linux-ppc64x 2020-10-29 17:53:57 +00:00
syscall_linux_riscv64.go syscall: handle undefined r2 value on linux-ppc64x 2020-10-29 17:53:57 +00:00
syscall_linux_s390x.go syscall: handle undefined r2 value on linux-ppc64x 2020-10-29 17:53:57 +00:00
syscall_linux_test.go syscall: improve TestSetuidEtc() /proc/ parsing against races 2020-11-11 20:49:53 +00:00
syscall_linux.go syscall: handle undefined r2 value on linux-ppc64x 2020-10-29 17:53:57 +00:00
syscall_netbsd_386.go
syscall_netbsd_amd64.go
syscall_netbsd_arm64.go
syscall_netbsd_arm.go
syscall_netbsd.go
syscall_openbsd_386.go
syscall_openbsd_amd64.go
syscall_openbsd_arm64.go
syscall_openbsd_arm.go
syscall_openbsd_mips64.go syscall: add support for openbsd/mips64 2020-10-29 08:08:26 +00:00
syscall_openbsd.go
syscall_plan9_test.go
syscall_plan9.go all: update references to symbols moved from os to io/fs 2020-10-20 02:32:42 +00:00
syscall_ptrace_test.go
syscall_solaris_amd64.go
syscall_solaris.go
syscall_test.go
syscall_unix_test.go all: update references to symbols moved from io/ioutil to io 2020-10-20 18:41:18 +00:00
syscall_unix.go all: update references to symbols moved from os to io/fs 2020-10-20 02:32:42 +00:00
syscall_windows_386.go
syscall_windows_amd64.go
syscall_windows_test.go
syscall_windows.go syscall: correct CertOpenStore to expect a 0 return value on failure 2020-12-05 12:36:42 +00:00
syscall.go syscall: switch go:generate directives back to mksyscall_windows.go 2020-11-02 15:31:49 +00:00
tables_js.go
time_fake.go
time_nofake.go
timestruct.go
types_aix.go
types_darwin.go syscall: implement Getwd using getcwd from libSystem on darwin 2020-09-26 10:09:33 +00:00
types_dragonfly.go
types_freebsd.go
types_illumos_amd64.go
types_linux.go
types_netbsd.go
types_openbsd.go
types_solaris.go
types_windows_386.go
types_windows_amd64.go
types_windows_arm.go
types_windows.go
zerrors_aix_ppc64.go
zerrors_darwin_amd64.go
zerrors_darwin_arm64.go
zerrors_dragonfly_amd64.go
zerrors_freebsd_386.go
zerrors_freebsd_amd64.go
zerrors_freebsd_arm64.go
zerrors_freebsd_arm.go
zerrors_linux_386.go
zerrors_linux_amd64.go
zerrors_linux_arm64.go
zerrors_linux_arm.go
zerrors_linux_mips64.go
zerrors_linux_mips64le.go
zerrors_linux_mips.go
zerrors_linux_mipsle.go
zerrors_linux_ppc64.go
zerrors_linux_ppc64le.go
zerrors_linux_riscv64.go
zerrors_linux_s390x.go
zerrors_netbsd_386.go
zerrors_netbsd_amd64.go
zerrors_netbsd_arm64.go
zerrors_netbsd_arm.go
zerrors_openbsd_386.go
zerrors_openbsd_amd64.go
zerrors_openbsd_arm64.go
zerrors_openbsd_arm.go
zerrors_openbsd_mips64.go syscall: add support for openbsd/mips64 2020-10-29 08:08:26 +00:00
zerrors_solaris_amd64.go
zerrors_windows_386.go
zerrors_windows_amd64.go
zerrors_windows.go
zsyscall_aix_ppc64.go
zsyscall_darwin_amd64.go syscall: implement Getwd using getcwd from libSystem on darwin 2020-09-26 10:09:33 +00:00
zsyscall_darwin_amd64.s syscall: implement Getwd using getcwd from libSystem on darwin 2020-09-26 10:09:33 +00:00
zsyscall_darwin_arm64.go syscall: support ptrace on macOS/ARM64 2020-10-08 23:14:40 +00:00
zsyscall_darwin_arm64.s syscall: support ptrace on macOS/ARM64 2020-10-08 23:14:40 +00:00
zsyscall_dragonfly_amd64.go
zsyscall_freebsd_386.go
zsyscall_freebsd_amd64.go
zsyscall_freebsd_arm64.go
zsyscall_freebsd_arm.go
zsyscall_linux_386.go syscall: support POSIX semantics for Linux syscalls 2020-10-23 20:53:14 +00:00
zsyscall_linux_amd64.go syscall: support POSIX semantics for Linux syscalls 2020-10-23 20:53:14 +00:00
zsyscall_linux_arm64.go syscall: support POSIX semantics for Linux syscalls 2020-10-23 20:53:14 +00:00
zsyscall_linux_arm.go syscall: support POSIX semantics for Linux syscalls 2020-10-23 20:53:14 +00:00
zsyscall_linux_mips64.go syscall: support POSIX semantics for Linux syscalls 2020-10-23 20:53:14 +00:00
zsyscall_linux_mips64le.go syscall: support POSIX semantics for Linux syscalls 2020-10-23 20:53:14 +00:00
zsyscall_linux_mips.go syscall: support POSIX semantics for Linux syscalls 2020-10-23 20:53:14 +00:00
zsyscall_linux_mipsle.go syscall: support POSIX semantics for Linux syscalls 2020-10-23 20:53:14 +00:00
zsyscall_linux_ppc64.go syscall: support POSIX semantics for Linux syscalls 2020-10-23 20:53:14 +00:00
zsyscall_linux_ppc64le.go syscall: support POSIX semantics for Linux syscalls 2020-10-23 20:53:14 +00:00
zsyscall_linux_riscv64.go syscall: support POSIX semantics for Linux syscalls 2020-10-23 20:53:14 +00:00
zsyscall_linux_s390x.go syscall: support POSIX semantics for Linux syscalls 2020-10-23 20:53:14 +00:00
zsyscall_netbsd_386.go
zsyscall_netbsd_amd64.go
zsyscall_netbsd_arm64.go
zsyscall_netbsd_arm.go
zsyscall_openbsd_386.go
zsyscall_openbsd_amd64.go
zsyscall_openbsd_arm64.go
zsyscall_openbsd_arm.go
zsyscall_openbsd_mips64.go syscall: add support for openbsd/mips64 2020-10-29 08:08:26 +00:00
zsyscall_plan9_386.go
zsyscall_plan9_amd64.go
zsyscall_plan9_arm.go
zsyscall_solaris_amd64.go
zsyscall_windows.go syscall: correct CertOpenStore to expect a 0 return value on failure 2020-12-05 12:36:42 +00:00
zsysctl_openbsd.go
zsysnum_darwin_amd64.go
zsysnum_darwin_arm64.go
zsysnum_dragonfly_amd64.go
zsysnum_freebsd_386.go
zsysnum_freebsd_amd64.go
zsysnum_freebsd_arm64.go
zsysnum_freebsd_arm.go
zsysnum_linux_386.go
zsysnum_linux_amd64.go
zsysnum_linux_arm64.go
zsysnum_linux_arm.go
zsysnum_linux_mips64.go
zsysnum_linux_mips64le.go
zsysnum_linux_mips.go
zsysnum_linux_mipsle.go
zsysnum_linux_ppc64.go
zsysnum_linux_ppc64le.go
zsysnum_linux_riscv64.go
zsysnum_linux_s390x.go
zsysnum_netbsd_386.go
zsysnum_netbsd_amd64.go
zsysnum_netbsd_arm64.go
zsysnum_netbsd_arm.go
zsysnum_openbsd_386.go
zsysnum_openbsd_amd64.go
zsysnum_openbsd_arm64.go
zsysnum_openbsd_arm.go
zsysnum_openbsd_mips64.go syscall: add support for openbsd/mips64 2020-10-29 08:08:26 +00:00
zsysnum_plan9.go
zsysnum_solaris_amd64.go
zsysnum_windows_386.go
zsysnum_windows_amd64.go
ztypes_aix_ppc64.go
ztypes_darwin_amd64.go syscall: implement Getwd using getcwd from libSystem on darwin 2020-09-26 10:09:33 +00:00
ztypes_darwin_arm64.go syscall: implement Getwd using getcwd from libSystem on darwin 2020-09-26 10:09:33 +00:00
ztypes_dragonfly_amd64.go
ztypes_freebsd_386.go
ztypes_freebsd_amd64.go
ztypes_freebsd_arm64.go
ztypes_freebsd_arm.go
ztypes_linux_386.go
ztypes_linux_amd64.go
ztypes_linux_arm64.go
ztypes_linux_arm.go
ztypes_linux_mips64.go
ztypes_linux_mips64le.go
ztypes_linux_mips.go
ztypes_linux_mipsle.go
ztypes_linux_ppc64.go
ztypes_linux_ppc64le.go
ztypes_linux_riscv64.go
ztypes_linux_s390x.go
ztypes_netbsd_386.go
ztypes_netbsd_amd64.go
ztypes_netbsd_arm64.go
ztypes_netbsd_arm.go
ztypes_openbsd_386.go
ztypes_openbsd_amd64.go
ztypes_openbsd_arm64.go
ztypes_openbsd_arm.go
ztypes_openbsd_mips64.go syscall: add support for openbsd/mips64 2020-10-29 08:08:26 +00:00
ztypes_solaris_amd64.go