mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-30 01:04:57 +02:00
Fix certificate checking error message issue
1. Fixed issue (caption and message are interchanged) 2. Disabled lexerdll signature checking in debug mode Closes #3691, Fix #3688
This commit is contained in:
parent
97fce27cfe
commit
3cb8bc85a1
@ -228,7 +228,7 @@ bool VerifySignedLibrary(const wstring& filepath,
|
|||||||
display_name = display_name_buffer.get();
|
display_name = display_name_buffer.get();
|
||||||
|
|
||||||
} catch (wstring s) {
|
} catch (wstring s) {
|
||||||
::MessageBox(NULL, TEXT("DLL signature verification failed"), s.c_str(), MB_ICONERROR);
|
::MessageBox(NULL, s.c_str(), TEXT("DLL signature verification failed"), MB_ICONERROR);
|
||||||
OutputDebugString(TEXT("VerifyLibrary: error while getting certificate informations\n"));
|
OutputDebugString(TEXT("VerifyLibrary: error while getting certificate informations\n"));
|
||||||
status = false;
|
status = false;
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
@ -236,7 +236,7 @@ bool VerifySignedLibrary(const wstring& filepath,
|
|||||||
OutputDebugString(TEXT("VerifyLibrary: error while getting certificate informations\n"));
|
OutputDebugString(TEXT("VerifyLibrary: error while getting certificate informations\n"));
|
||||||
wstring errMsg(TEXT("Unknown exception occured. "));
|
wstring errMsg(TEXT("Unknown exception occured. "));
|
||||||
errMsg += GetLastErrorAsString(GetLastError());
|
errMsg += GetLastErrorAsString(GetLastError());
|
||||||
::MessageBox(NULL, TEXT("DLL signature verification failed"), errMsg.c_str(), MB_ICONERROR);
|
::MessageBox(NULL, errMsg.c_str(), TEXT("DLL signature verification failed"), MB_ICONERROR);
|
||||||
status = false;
|
status = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -206,6 +206,10 @@ HMODULE loadSciLexerDll()
|
|||||||
{
|
{
|
||||||
generic_string sciLexerPath = getSciLexerFullPathName(moduleFileName, 1024);
|
generic_string sciLexerPath = getSciLexerFullPathName(moduleFileName, 1024);
|
||||||
|
|
||||||
|
// Do not check dll signature if npp is running in debug mode
|
||||||
|
// This is helpful for developers to skip signature checking
|
||||||
|
// while analyzing issue or modifying the lexer dll
|
||||||
|
#ifndef _DEBUG
|
||||||
bool isOK = VerifySignedLibrary(sciLexerPath, SCINTILLA_SIGNER_KEY_ID, SCINTILLA_SIGNER_SUBJECT, SCINTILLA_SIGNER_DISPLAY_NAME, false, false);
|
bool isOK = VerifySignedLibrary(sciLexerPath, SCINTILLA_SIGNER_KEY_ID, SCINTILLA_SIGNER_SUBJECT, SCINTILLA_SIGNER_DISPLAY_NAME, false, false);
|
||||||
|
|
||||||
if (!isOK)
|
if (!isOK)
|
||||||
@ -216,6 +220,7 @@ HMODULE loadSciLexerDll()
|
|||||||
MB_OK | MB_ICONERROR);
|
MB_OK | MB_ICONERROR);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
#endif // !_DEBUG
|
||||||
|
|
||||||
return ::LoadLibrary(sciLexerPath.c_str());
|
return ::LoadLibrary(sciLexerPath.c_str());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user