diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-11-29 13:33:37 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-12-05 12:36:42 +0000 |
commit | be9379f8a8e2bfd924966020d177552d01833fdb (patch) | |
tree | db23482d49a7ea01f4436d97d13f9bb4fc0c5c77 /src/vendor | |
parent | 4de4480dc34fbe4f7b0ed97eada26aef7a7e2337 (diff) | |
download | go-be9379f8a8e2bfd924966020d177552d01833fdb.tar.gz go-be9379f8a8e2bfd924966020d177552d01833fdb.zip |
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>
Diffstat (limited to 'src/vendor')
-rw-r--r-- | src/vendor/golang.org/x/sys/cpu/asm_aix_ppc64.s | 2 | ||||
-rw-r--r-- | src/vendor/golang.org/x/sys/cpu/cpu_arm64.s | 2 | ||||
-rw-r--r-- | src/vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go | 2 | ||||
-rw-r--r-- | src/vendor/golang.org/x/sys/cpu/cpu_gc_s390x.go | 2 | ||||
-rw-r--r-- | src/vendor/golang.org/x/sys/cpu/cpu_gc_x86.go | 2 | ||||
-rw-r--r-- | src/vendor/golang.org/x/sys/cpu/cpu_s390x.s | 2 | ||||
-rw-r--r-- | src/vendor/golang.org/x/sys/cpu/cpu_x86.s | 2 | ||||
-rw-r--r-- | src/vendor/golang.org/x/sys/cpu/syscall_aix_ppc64_gc.go | 2 | ||||
-rw-r--r-- | src/vendor/modules.txt | 2 |
9 files changed, 9 insertions, 9 deletions
diff --git a/src/vendor/golang.org/x/sys/cpu/asm_aix_ppc64.s b/src/vendor/golang.org/x/sys/cpu/asm_aix_ppc64.s index 06f84b8555..6b4027b33f 100644 --- a/src/vendor/golang.org/x/sys/cpu/asm_aix_ppc64.s +++ b/src/vendor/golang.org/x/sys/cpu/asm_aix_ppc64.s @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build !gccgo +// +build gc #include "textflag.h" diff --git a/src/vendor/golang.org/x/sys/cpu/cpu_arm64.s b/src/vendor/golang.org/x/sys/cpu/cpu_arm64.s index a54436e390..cfc08c9794 100644 --- a/src/vendor/golang.org/x/sys/cpu/cpu_arm64.s +++ b/src/vendor/golang.org/x/sys/cpu/cpu_arm64.s @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build !gccgo +// +build gc #include "textflag.h" diff --git a/src/vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go b/src/vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go index 7b88e865a4..7f7f272a01 100644 --- a/src/vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go +++ b/src/vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build !gccgo +// +build gc package cpu diff --git a/src/vendor/golang.org/x/sys/cpu/cpu_gc_s390x.go b/src/vendor/golang.org/x/sys/cpu/cpu_gc_s390x.go index 568bcd031a..75a9556616 100644 --- a/src/vendor/golang.org/x/sys/cpu/cpu_gc_s390x.go +++ b/src/vendor/golang.org/x/sys/cpu/cpu_gc_s390x.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build !gccgo +// +build gc package cpu diff --git a/src/vendor/golang.org/x/sys/cpu/cpu_gc_x86.go b/src/vendor/golang.org/x/sys/cpu/cpu_gc_x86.go index f7cb46971c..4adb89cf9c 100644 --- a/src/vendor/golang.org/x/sys/cpu/cpu_gc_x86.go +++ b/src/vendor/golang.org/x/sys/cpu/cpu_gc_x86.go @@ -3,7 +3,7 @@ // license that can be found in the LICENSE file. // +build 386 amd64 amd64p32 -// +build !gccgo +// +build gc package cpu diff --git a/src/vendor/golang.org/x/sys/cpu/cpu_s390x.s b/src/vendor/golang.org/x/sys/cpu/cpu_s390x.s index e5037d92e0..964946df95 100644 --- a/src/vendor/golang.org/x/sys/cpu/cpu_s390x.s +++ b/src/vendor/golang.org/x/sys/cpu/cpu_s390x.s @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build !gccgo +// +build gc #include "textflag.h" diff --git a/src/vendor/golang.org/x/sys/cpu/cpu_x86.s b/src/vendor/golang.org/x/sys/cpu/cpu_x86.s index 47f084128c..2f557a5887 100644 --- a/src/vendor/golang.org/x/sys/cpu/cpu_x86.s +++ b/src/vendor/golang.org/x/sys/cpu/cpu_x86.s @@ -3,7 +3,7 @@ // license that can be found in the LICENSE file. // +build 386 amd64 amd64p32 -// +build !gccgo +// +build gc #include "textflag.h" diff --git a/src/vendor/golang.org/x/sys/cpu/syscall_aix_ppc64_gc.go b/src/vendor/golang.org/x/sys/cpu/syscall_aix_ppc64_gc.go index 78fe25e86f..5b427d67e2 100644 --- a/src/vendor/golang.org/x/sys/cpu/syscall_aix_ppc64_gc.go +++ b/src/vendor/golang.org/x/sys/cpu/syscall_aix_ppc64_gc.go @@ -7,7 +7,7 @@ // (See golang.org/issue/32102) // +build aix,ppc64 -// +build !gccgo +// +build gc package cpu diff --git a/src/vendor/modules.txt b/src/vendor/modules.txt index 24a3751400..de727ef71f 100644 --- a/src/vendor/modules.txt +++ b/src/vendor/modules.txt @@ -18,7 +18,7 @@ golang.org/x/net/idna golang.org/x/net/lif golang.org/x/net/nettest golang.org/x/net/route -# golang.org/x/sys v0.0.0-20201110211018-35f3e6cf4a65 +# golang.org/x/sys v0.0.0-20201204225414-ed752295db88 ## explicit golang.org/x/sys/cpu # golang.org/x/text v0.3.4 |