1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2025-11-11 19:08:26 -06:00

Windows: in DEBUG mode, disable verification to Authenticode signature of binaries.

This commit is contained in:
Mounir IDRASSI
2018-06-22 20:28:33 +02:00
parent 22b9ca94b3
commit eb22f70065
2 changed files with 5 additions and 3 deletions

View File

@@ -2849,7 +2849,7 @@ void InitApp (HINSTANCE hInstance, wchar_t *lpszCommandLine)
LoadSystemDll (L"Riched20.dll", &hRichEditDll, FALSE, SRC_POS); LoadSystemDll (L"Riched20.dll", &hRichEditDll, FALSE, SRC_POS);
#if defined(NDEBUG) && !defined(SETUP) #if !defined(SETUP)
if (!VerifyModuleSignature (modPath)) if (!VerifyModuleSignature (modPath))
AbortProcess ("DIST_PACKAGE_CORRUPTED"); AbortProcess ("DIST_PACKAGE_CORRUPTED");
#endif #endif
@@ -13459,6 +13459,7 @@ static void FinalizeWintrust()
BOOL VerifyModuleSignature (const wchar_t* path) BOOL VerifyModuleSignature (const wchar_t* path)
{ {
#ifdef NDEBUG
BOOL bResult = FALSE; BOOL bResult = FALSE;
HRESULT hResult; HRESULT hResult;
GUID gActionID = WINTRUST_ACTION_GENERIC_VERIFY_V2; GUID gActionID = WINTRUST_ACTION_GENERIC_VERIFY_V2;
@@ -13526,6 +13527,9 @@ BOOL VerifyModuleSignature (const wchar_t* path)
FinalizeWintrust (); FinalizeWintrust ();
return bResult; return bResult;
#else
return TRUE;
#endif
} }
void GetInstallationPath (HWND hwndDlg, wchar_t* szInstallPath, DWORD cchSize, BOOL* pbInstallPathDetermined) void GetInstallationPath (HWND hwndDlg, wchar_t* szInstallPath, DWORD cchSize, BOOL* pbInstallPathDetermined)

View File

@@ -401,14 +401,12 @@ BOOL VerifyPackageIntegrity (const wchar_t *path)
unsigned char *tmpBuffer; unsigned char *tmpBuffer;
int tmpFileSize; int tmpFileSize;
#ifdef NDEBUG
// verify Authenticode digital signature of the exe file // verify Authenticode digital signature of the exe file
if (!VerifyModuleSignature (path)) if (!VerifyModuleSignature (path))
{ {
Error ("DIST_PACKAGE_CORRUPTED", NULL); Error ("DIST_PACKAGE_CORRUPTED", NULL);
return FALSE; return FALSE;
} }
#endif
fileDataEndPos = (int) FindStringInFile (path, MagEndMarker, strlen (MagEndMarker)); fileDataEndPos = (int) FindStringInFile (path, MagEndMarker, strlen (MagEndMarker));
if (fileDataEndPos < 0) if (fileDataEndPos < 0)