-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* WinTrust.lib is responsible for the MSASN1.dll sideloading issue described in #1877, so, since we only use it for WinVerifyTrustEx(), hook into that function manually. * Closes #1877 for the MinGW side. * Note that we will probably try to use the method suggested by @assarbad and documented at https://stackoverflow.com/questions/1851267/mingw-gcc-delay-loaded-dll-equivalent/70416894#70416894 to try to put an end to the problem of DLL side loading.
- Loading branch information
Showing
6 changed files
with
38 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
* Rufus: The Reliable USB Formatting Utility | ||
* PKI functions (code signing, etc.) | ||
* Copyright © 2015-2016 Pete Batard <[email protected]> | ||
* Copyright © 2015-2022 Pete Batard <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
|
@@ -572,9 +572,11 @@ uint64_t GetSignatureTimeStamp(const char* path) | |
// From https://msdn.microsoft.com/en-us/library/windows/desktop/aa382384.aspx | ||
LONG ValidateSignature(HWND hDlg, const char* path) | ||
{ | ||
LONG r; | ||
LONG r = TRUST_E_SYSTEM_ERROR; | ||
WINTRUST_DATA trust_data = { 0 }; | ||
WINTRUST_FILE_INFO trust_file = { 0 }; | ||
PF_TYPE_DECL(WINAPI, long, WinVerifyTrustEx, (HWND, GUID*, WINTRUST_DATA*)); | ||
PF_INIT(WinVerifyTrustEx, WinTrust); | ||
GUID guid_generic_verify = // WINTRUST_ACTION_GENERIC_VERIFY_V2 | ||
{ 0xaac56b, 0xcd44, 0x11d0,{ 0x8c, 0xc2, 0x0, 0xc0, 0x4f, 0xc2, 0x95, 0xee } }; | ||
char *signature_name; | ||
|
@@ -625,7 +627,8 @@ LONG ValidateSignature(HWND hDlg, const char* path) | |
trust_data.dwUnionChoice = WTD_CHOICE_FILE; | ||
trust_data.pFile = &trust_file; | ||
|
||
r = WinVerifyTrustEx(INVALID_HANDLE_VALUE, &guid_generic_verify, &trust_data); | ||
if (pfWinVerifyTrustEx != NULL) | ||
r = pfWinVerifyTrustEx(INVALID_HANDLE_VALUE, &guid_generic_verify, &trust_data); | ||
safe_free(trust_file.pcwszFilePath); | ||
switch (r) { | ||
case ERROR_SUCCESS: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters