diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2021-06-27 15:34:47 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2021-07-29 01:31:39 +0200 |
commit | 3e58acaf32b77bb92a4b8b640611a209525b313f (patch) | |
tree | 3e11175bacfde81fe095722a320b39c3f82d1630 | |
parent | mod: bump (diff) | |
download | wireguard-windows-3e58acaf32b77bb92a4b8b640611a209525b313f.tar.xz wireguard-windows-3e58acaf32b77bb92a4b8b640611a209525b313f.zip |
updater: use correct constant for authentication verification and free
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r-- | updater/authenticode.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/updater/authenticode.go b/updater/authenticode.go index d6d80df5..11aa84d6 100644 --- a/updater/authenticode.go +++ b/updater/authenticode.go @@ -21,11 +21,14 @@ func verifyAuthenticode(path string) bool { UIChoice: windows.WTD_UI_NONE, RevocationChecks: windows.WTD_REVOKE_WHOLECHAIN, // Full revocation checking, as this is called with network connectivity. UnionChoice: windows.WTD_CHOICE_FILE, - StateAction: windows.WTD_STATEACTION_VERIFY, + StateAction: 1, // Should be `windows.WTD_STATEACTION_VERIFY`, but the constant is wrong right now. FileOrCatalogOrBlobOrSgnrOrCert: unsafe.Pointer(&windows.WinTrustFileInfo{ Size: uint32(unsafe.Sizeof(windows.WinTrustFileInfo{})), FilePath: path16, }), } - return windows.WinVerifyTrustEx(windows.InvalidHWND, &windows.WINTRUST_ACTION_GENERIC_VERIFY_V2, data) == nil + verified := windows.WinVerifyTrustEx(windows.InvalidHWND, &windows.WINTRUST_ACTION_GENERIC_VERIFY_V2, data) == nil + data.StateAction = windows.WTD_STATEACTION_CLOSE + windows.WinVerifyTrustEx(windows.InvalidHWND, &windows.WINTRUST_ACTION_GENERIC_VERIFY_V2, data) + return verified } |