aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2021-07-31 01:56:33 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2021-08-02 13:54:04 +0200
commit142863883e0a1be9125eb544cb86492c18566e03 (patch)
treeec38e90548747eab44e66447e269252db2406e70
parentbuild: use official go builds and patch locally (diff)
downloadwireguard-windows-142863883e0a1be9125eb544cb86492c18566e03.tar.xz
wireguard-windows-142863883e0a1be9125eb544cb86492c18566e03.zip
fetcher: close winverifytrust handle after usage
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r--installer/fetcher/fetcher.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/installer/fetcher/fetcher.c b/installer/fetcher/fetcher.c
index e9d23567..8253b16d 100644
--- a/installer/fetcher/fetcher.c
+++ b/installer/fetcher/fetcher.c
@@ -181,7 +181,10 @@ static DWORD __stdcall download_thread(void *param)
CloseHandle(filehandle); //TODO: I wish this wasn't required.
filehandle = INVALID_HANDLE_VALUE;
wintrust_fileinfo.pcwszFilePath = L(msi_filename);
- if (WinVerifyTrust(INVALID_HANDLE_VALUE, &(GUID)WINTRUST_ACTION_GENERIC_VERIFY_V2, &wintrust_data))
+ ret = WinVerifyTrustEx(INVALID_HANDLE_VALUE, &(GUID)WINTRUST_ACTION_GENERIC_VERIFY_V2, &wintrust_data);
+ wintrust_data.dwStateAction = WTD_STATEACTION_CLOSE;
+ WinVerifyTrustEx(INVALID_HANDLE_VALUE, &(GUID)WINTRUST_ACTION_GENERIC_VERIFY_V2, &wintrust_data);
+ if (ret)
goto out;
set_status(progress, "launching installer");