summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDuyoung Jang <duyoung.jang@samsung.com>2012-11-20 18:36:52 +0900
committerDuyoung Jang <duyoung.jang@samsung.com>2012-11-20 18:36:52 +0900
commit9b9d397b18b986af8c6a79de9c0134bfafb7fb96 (patch)
treec3aedb0f0f4456a315eef0d8fcf5433e012fff5d /src
parent7ed35ab43f910128bca2127a7a3d4393dd7b3e1a (diff)
downloadinstaller-9b9d397b18b986af8c6a79de9c0134bfafb7fb96.tar.gz
installer-9b9d397b18b986af8c6a79de9c0134bfafb7fb96.tar.bz2
installer-9b9d397b18b986af8c6a79de9c0134bfafb7fb96.zip
Modify to check verification mode
Change-Id: I29f908914fdeb530f337aa7f4894265083f0b01d
Diffstat (limited to 'src')
-rwxr-xr-xsrc/Context/InstallationContext.cpp13
-rwxr-xr-xsrc/Context/InstallationContext.h4
-rwxr-xr-xsrc/Step/PackageCheckStep.cpp8
-rwxr-xr-xsrc/Step/SignatureStep.cpp7
-rwxr-xr-xsrc/XmlHandler/ManifestHandler.cpp8
5 files changed, 28 insertions, 12 deletions
diff --git a/src/Context/InstallationContext.cpp b/src/Context/InstallationContext.cpp
index 6b00330..c3d30a6 100755
--- a/src/Context/InstallationContext.cpp
+++ b/src/Context/InstallationContext.cpp
@@ -48,6 +48,7 @@ InstallationContext::InstallationContext(void)
,__continue(true)
,__preloaded(false)
,__hybridService(false)
+,__verificationMode(false)
,__operation(INSTALLER_OPERATION_INSTALL)
,__storage(INSTALLATION_STORAGE_INTERNAL)
,__pPrivilegeList(null)
@@ -275,6 +276,18 @@ InstallationContext::SetHybridService(bool hybridService)
__hybridService = hybridService;
}
+bool
+InstallationContext::IsVerificationMode(void)
+{
+ return __verificationMode;
+}
+
+void
+InstallationContext::SetVerificationMode(bool verificationMode)
+{
+ __verificationMode = verificationMode;
+}
+
const String&
InstallationContext::GetPackagePath(void) const
{
diff --git a/src/Context/InstallationContext.h b/src/Context/InstallationContext.h
index 3315496..1a62672 100755
--- a/src/Context/InstallationContext.h
+++ b/src/Context/InstallationContext.h
@@ -87,6 +87,9 @@ public:
bool IsHybridService(void);
void SetHybridService(bool hybridService);
+ bool IsVerificationMode(void);
+ void SetVerificationMode(bool verificationMode);
+
const Osp::Base::String& GetPackagePath(void) const;
void SetPackagePath(const Osp::Base::String& packagePath);
@@ -152,6 +155,7 @@ private:
bool __continue;
bool __preloaded;
bool __hybridService;
+ bool __verificationMode;
Osp::Base::String __inputPath;
InstallerOperation __operation;
diff --git a/src/Step/PackageCheckStep.cpp b/src/Step/PackageCheckStep.cpp
index c005fde..49a77d5 100755
--- a/src/Step/PackageCheckStep.cpp
+++ b/src/Step/PackageCheckStep.cpp
@@ -131,8 +131,16 @@ PackageCheckStep::OnStatePackageCheck(void)
AppLogTag(OSP_INSTALLER, "UnzipTo(manifest.xml) - START");
unzipper.UnzipTo(tempDir, L"info/manifest.xml");
unzipper.UnzipTo(tempDir, L"signature1.xml");
+ unzipper.UnzipTo(tempDir, L"author-signature.xml");
AppLogTag(OSP_INSTALLER, "UnzipTo(manifest.xml) - END");
+ if ((File::IsFileExist(__pContext->GetSignatureXmlPath()) == true) &&
+ (File::IsFileExist(__pContext->GetAuthorSignatureXmlPath()) == true))
+ {
+ AppLogTag(OSP_INSTALLER, "[VerifySignature] VerificationMode ON");
+ __pContext->SetVerificationMode(true);
+ }
+
GoNextState();
return error;
}
diff --git a/src/Step/SignatureStep.cpp b/src/Step/SignatureStep.cpp
index c6e7d7a..536f88d 100755
--- a/src/Step/SignatureStep.cpp
+++ b/src/Step/SignatureStep.cpp
@@ -55,12 +55,7 @@ SignatureStep::Run(InstallationContext* pContext)
__pContext = pContext;
- // signature.xml for beta
- FileAttributes attr;
- result r = E_SUCCESS;
-
- r = File::GetAttributes(__pContext->GetSignatureXmlPath(), attr);
- if (r != E_SUCCESS)
+ if (__pContext->IsVerificationMode() == false)
{
AppLogTag(OSP_INSTALLER, "Signature file not found. path = [%ls]\n", __pContext->GetSignatureXmlPath().GetPointer());
return INSTALLER_ERROR_NONE;
diff --git a/src/XmlHandler/ManifestHandler.cpp b/src/XmlHandler/ManifestHandler.cpp
index c7a8503..fd1115c 100755
--- a/src/XmlHandler/ManifestHandler.cpp
+++ b/src/XmlHandler/ManifestHandler.cpp
@@ -394,15 +394,11 @@ ManifestHandler::OnPrivilegesElement(void)
bool
ManifestHandler::OnPrivilegesEndElement(void)
{
- // signature.xml for beta
- FileAttributes attr;
- result r = E_SUCCESS;
-
- r = File::GetAttributes(__pContext->GetSignatureXmlPath(), attr);
- if (r != E_SUCCESS)
+ if (__pContext->IsVerificationMode() == false)
{
AppLogTag(OSP_INSTALLER, "Signature file not found. [%ls]\n", __pContext->GetSignatureXmlPath().GetPointer());
+ result r = E_SUCCESS;
String privileges;
String hmacPrivileges;
String appId = __pPackageInfoImpl->GetAppId();