[EU-FOSSA] Check Updater's certificate before launching it
This commit is contained in:
parent
1ab1624800
commit
501980782f
@ -37,6 +37,7 @@
|
||||
#include "functionListPanel.h"
|
||||
#include "fileBrowser.h"
|
||||
#include "Sorters.h"
|
||||
#include "verifySignedFile.h"
|
||||
#include "LongRunningOperation.h"
|
||||
#include "md5.h"
|
||||
#include "sha-256.h"
|
||||
@ -2811,6 +2812,15 @@ void Notepad_plus::command(int id)
|
||||
generic_string updaterFullPath = updaterDir;
|
||||
PathAppend(updaterFullPath, TEXT("gup.exe"));
|
||||
|
||||
|
||||
#ifdef DEBUG // if not debug, then it's release
|
||||
bool isCertifVerified = true;
|
||||
#else //RELEASE
|
||||
// check the signature on updater
|
||||
bool isCertifVerified = VerifySignedLibrary(updaterFullPath.c_str(), NPP_COMPONENT_SIGNER_KEY_ID, NPP_COMPONENT_SIGNER_SUBJECT, NPP_COMPONENT_SIGNER_DISPLAY_NAME, false, false, false);
|
||||
#endif
|
||||
if (isCertifVerified)
|
||||
{
|
||||
generic_string param;
|
||||
if (id == IDM_CONFUPDATERPROXY)
|
||||
{
|
||||
@ -2830,6 +2840,7 @@ void Notepad_plus::command(int id)
|
||||
|
||||
updater.run();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user