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/cmd/go.mod | |
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/cmd/go.mod')
-rw-r--r-- | src/cmd/go.mod | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/go.mod b/src/cmd/go.mod index 46ec54b5a2..98ef23d61b 100644 --- a/src/cmd/go.mod +++ b/src/cmd/go.mod @@ -7,6 +7,6 @@ require ( golang.org/x/arch v0.0.0-20201008161808-52c3e6f60cff golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 golang.org/x/mod v0.4.0 - golang.org/x/sys v0.0.0-20201110211018-35f3e6cf4a65 // indirect + golang.org/x/sys v0.0.0-20201204225414-ed752295db88 // indirect golang.org/x/tools v0.0.0-20201110201400-7099162a900a ) |