VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2018-04-16 11:04:57 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2018-04-23 16:59:31 +0200
commitcce74aaee0a96b13b5793de4f2f2099ea1d29338 (patch)
treee96cf2fb367c509be0ded42dc23fb0a14d6e8d01 /src/Common
parent3f3a567782634f0759a58a68371563a8aaf39bb0 (diff)
downloadVeraCrypt-cce74aaee0a96b13b5793de4f2f2099ea1d29338.tar.gz
VeraCrypt-cce74aaee0a96b13b5793de4f2f2099ea1d29338.zip
Windows: handle case when parameter of VerifyModuleSignature is enclosed between quotation marks
Diffstat (limited to 'src/Common')
-rw-r--r--src/Common/Dlgcode.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/Common/Dlgcode.c b/src/Common/Dlgcode.c
index fdff1f07..347f1207 100644
--- a/src/Common/Dlgcode.c
+++ b/src/Common/Dlgcode.c
@@ -13457,12 +13457,27 @@ BOOL VerifyModuleSignature (const wchar_t* path)
GUID gActionID = WINTRUST_ACTION_GENERIC_VERIFY_V2;
WINTRUST_FILE_INFO fileInfo = {0};
WINTRUST_DATA WVTData = {0};
+ wchar_t filePath [TC_MAX_PATH + 1024];
+
+ // Strip quotation marks (if any)
+ if (path [0] == L'"')
+ {
+ StringCbCopyW (filePath, sizeof(filePath), path + 1);
+ }
+ else
+ {
+ StringCbCopyW (filePath, sizeof(filePath), path);
+ }
+
+ // Strip quotation marks (if any)
+ if (filePath [wcslen (filePath) - 1] == L'"')
+ filePath [wcslen (filePath) - 1] = 0;
if (!InitializeWintrust ())
return FALSE;
fileInfo.cbStruct = sizeof(WINTRUST_FILE_INFO);
- fileInfo.pcwszFilePath = path;
+ fileInfo.pcwszFilePath = filePath;
fileInfo.hFile = NULL;
WVTData.cbStruct = sizeof(WINTRUST_DATA);