Fix verifying certificate function passes empty string to compare

For unknown reason, all strings passed by parameters are empty string,
use the macros solve this problem.
This commit is contained in:
Don HO 2017-06-15 02:25:25 +02:00
parent 39b2386b33
commit 6f84824c2b
2 changed files with 7 additions and 5 deletions

View File

@ -240,7 +240,9 @@ bool VerifySignedLibrary(const wstring& filepath,
status = false;
}
// fields verifications
//
// fields verifications - if status is true, and string to compare (from the parameter) is not empty, then do compare
//
if ( status && !cert_display_name.empty() && cert_display_name != display_name )
{
status = false;

View File

@ -152,9 +152,9 @@ LanguageName ScintillaEditView::langNames[L_EXTERNAL+1] = {
//const int MASK_GREEN = 0x00FF00;
//const int MASK_BLUE = 0x0000FF;
const generic_string scintilla_signer_display_name = TEXT("Notepad++");
const generic_string scintilla_signer_subject = TEXT("C=FR, S=Ile-de-France, L=Saint Cloud, O=\"Notepad++\", CN=\"Notepad++\"");
const generic_string scintilla_signer_key_id = TEXT("42C4C5846BB675C74E2B2C90C69AB44366401093");
#define SCINTILLA_SIGNER_DISPLAY_NAME TEXT("Notepad++")
#define SCINTILLA_SIGNER_SUBJECT TEXT("C=FR, S=Ile-de-France, L=Saint Cloud, O=\"Notepad++\", CN=\"Notepad++\"")
#define SCINTILLA_SIGNER_KEY_ID TEXT("42C4C5846BB675C74E2B2C90C69AB44366401093")
int getNbDigits(int aNum, int base)
@ -185,7 +185,7 @@ HMODULE loadSciLexerDll()
{
generic_string sciLexerPath = getSciLexerFullPathName(moduleFileName, 1024);
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)
{