Disable integrity checks in Debug

Close #5884
This commit is contained in:
Silent 2019-07-04 23:35:26 +02:00 committed by Don HO
parent 31ae813286
commit 401dbbc7d5
No known key found for this signature in database
GPG Key ID: 6C429F1D8D84F46E
1 changed files with 9 additions and 0 deletions

View File

@ -62,12 +62,21 @@ SecurityGard::SecurityGard()
bool SecurityGard::checkModule(const std::wstring& filePath, NppModule module2check)
{
#ifndef _DEBUG
if (_securityMode == sm_certif)
return verifySignedLibrary(filePath, module2check);
else if (_securityMode == sm_sha256)
return checkSha256(filePath, module2check);
else
return false;
#else
// Do not check integrity if npp is running in debug mode
// This is helpful for developers to skip signature checking
// while analyzing issue or modifying the lexer dll
(void)filePath;
(void)module2check;
return true;
#endif
}
bool SecurityGard::checkSha256(const std::wstring& filePath, NppModule module2check)