From bd2e6eb2ec5ff548ca32669fa0a5931909cd7c7a Mon Sep 17 00:00:00 2001 From: Duyoung Jang Date: Tue, 27 Aug 2013 13:50:20 +0900 Subject: [PATCH] Mandatorily check signature verification Change-Id: I287d9075c342a28c32f9b3df0cdcc4435a71cc7a Signed-off-by: Duyoung Jang --- inc/InstallerDefs.h | 2 +- src/Context/InstallationContext.cpp | 2 +- src/Installer/DirectoryInstaller.cpp | 13 ++++++++----- src/Step/PackageCheckStep.cpp | 11 ++--------- 4 files changed, 12 insertions(+), 16 deletions(-) diff --git a/inc/InstallerDefs.h b/inc/InstallerDefs.h index 8ef969e..6290ade 100755 --- a/inc/InstallerDefs.h +++ b/inc/InstallerDefs.h @@ -23,7 +23,7 @@ #include "InstallerUtil.h" -#define OSP_INSTALLER_VERSION "version=[20130826.3]" +#define OSP_INSTALLER_VERSION "version=[20130827.1]" #define DIR_BIN L"/bin" #define DIR_INFO L"/info" diff --git a/src/Context/InstallationContext.cpp b/src/Context/InstallationContext.cpp index c4efb1a..1066c8f 100755 --- a/src/Context/InstallationContext.cpp +++ b/src/Context/InstallationContext.cpp @@ -49,7 +49,7 @@ InstallationContext::InstallationContext(void) ,__isOspCompat(false) ,__isPreloaded(false) ,__isHybridService(false) -,__isVerificationMode(false) +,__isVerificationMode(true) ,__isUpdated(false) ,__isAppSetting(false) ,__isCsc(false) diff --git a/src/Installer/DirectoryInstaller.cpp b/src/Installer/DirectoryInstaller.cpp index d0a2b9b..0a13956 100755 --- a/src/Installer/DirectoryInstaller.cpp +++ b/src/Installer/DirectoryInstaller.cpp @@ -72,12 +72,15 @@ DirectoryInstaller::OnInit(void) { InstallationContext* pContext = GetContext(); - if ((File::IsFileExist(pContext->GetSignatureXmlPath()) == true) && - (File::IsFileExist(pContext->GetAuthorSignatureXmlPath()) == true) && - (pContext->__isHybridService == false)) + if (pContext->__isHybridService == true) { - AppLog("[VerifySignature] VerificationMode ON"); - pContext->__isVerificationMode = true; + AppLog("[VerifySignature] VerificationMode OFF"); + pContext->__isVerificationMode = false; + } + else + { + TryReturn(File::IsFileExist(pContext->GetAuthorSignatureXmlPath()) == true, INSTALLER_ERROR_PACKAGE_INVALID, "no author-signature.xml"); + TryReturn(File::IsFileExist(pContext->GetSignatureXmlPath()) == true, INSTALLER_ERROR_PACKAGE_INVALID, "no signature1.xml"); } String installPath = pContext->__installDir; diff --git a/src/Step/PackageCheckStep.cpp b/src/Step/PackageCheckStep.cpp index ecd9c45..4b00ddb 100755 --- a/src/Step/PackageCheckStep.cpp +++ b/src/Step/PackageCheckStep.cpp @@ -141,20 +141,13 @@ PackageCheckStep::OnStatePackageCheck(void) TryReturn(!IsFailed(r), INSTALLER_ERROR_PACKAGE_INVALID, "UnzipTo(manifest.xml) failed."); r = unzipper.UnzipTo(tempDir, L"signature1.xml"); - //TryReturn(!IsFailed(r), INSTALLER_ERROR_PACKAGE_INVALID, "UnzipTo(signature1.xml) failed."); + TryReturn(!IsFailed(r), INSTALLER_ERROR_PACKAGE_INVALID, "UnzipTo(signature1.xml) failed."); r = unzipper.UnzipTo(tempDir, L"author-signature.xml"); - //TryReturn(!IsFailed(r), INSTALLER_ERROR_PACKAGE_INVALID, "UnzipTo(author-signature.xml) failed."); + TryReturn(!IsFailed(r), INSTALLER_ERROR_PACKAGE_INVALID, "UnzipTo(author-signature.xml) failed."); AppLog("UnzipTo(manifest.xml) - END"); - if ((File::IsFileExist(__pContext->GetSignatureXmlPath()) == true) && - (File::IsFileExist(__pContext->GetAuthorSignatureXmlPath()) == true)) - { - AppLog("[VerifySignature] VerificationMode ON"); - __pContext->__isVerificationMode = true; - } - GoNextState(); return error; } -- 2.7.4