[Release] wrt-installer_0.1.114
[framework/web/wrt-installer.git] / src / jobs / widget_install / task_certify.cpp
index 2b3d81d..a610cb6 100644 (file)
@@ -125,19 +125,20 @@ TaskCertify::TaskCertify(InstallerContext &inCont) :
     DPL::TaskDecl<TaskCertify>(this),
     m_contextData(inCont)
 {
+    AddStep(&TaskCertify::StartStep);
     AddStep(&TaskCertify::stepSignature);
     // certi comparison determines whether the update.
     if (true == m_contextData.isUpdateMode) {
         AddStep(&TaskCertify::stepVerifyUpdate);
     }
-    AddStep(&TaskCertify::stepFinalize);
+    AddStep(&TaskCertify::EndStep);
 }
 
 void TaskCertify::processDistributorSignature(const SignatureData &data)
 {
     // this signature is verified -
     // no point in check domain WAC_ROOT and WAC_RECOGNIZED
-    m_contextData.wacSecurity.setDistributorSigned(true);
+    m_contextData.widgetSecurity.setDistributorSigned(true);
 
     CertificateCollection collection;
     collection.load(data.getCertList());
@@ -148,13 +149,13 @@ void TaskCertify::processDistributorSignature(const SignatureData &data)
            "Certificate collection is not able to create chain. "
            "It is not possible to verify this signature.");
 
-    m_contextData.wacSecurity.getCertificateChainListRef().push_back(
+    m_contextData.widgetSecurity.getCertificateChainListRef().push_back(
         collection);
 
     if (data.getSignatureNumber() == 1) {
-        m_contextData.wacSecurity.getCertificateListRef().push_back(
+        m_contextData.widgetSecurity.getCertificateListRef().push_back(
             toWidgetCertificateData(data, true));
-        m_contextData.wacSecurity.getCertificateListRef().push_back(
+        m_contextData.widgetSecurity.getCertificateListRef().push_back(
             toWidgetCertificateData(data, false));
     }
 }
@@ -162,14 +163,14 @@ void TaskCertify::processDistributorSignature(const SignatureData &data)
 void TaskCertify::processAuthorSignature(const SignatureData &data)
 {
     using namespace ValidationCore;
-    LogInfo("DNS Identity match!");
+    LogDebug("DNS Identity match!");
     // this signature is verified or widget is distributor signed
-    m_contextData.wacSecurity.setAuthorCertificatePtr(data.getEndEntityCertificatePtr());
-    CertificatePtr test = m_contextData.wacSecurity.getAuthorCertificatePtr();
+    m_contextData.widgetSecurity.setAuthorCertificatePtr(data.getEndEntityCertificatePtr());
+    CertificatePtr test = m_contextData.widgetSecurity.getAuthorCertificatePtr();
 
-    m_contextData.wacSecurity.getCertificateListRef().push_back(
+    m_contextData.widgetSecurity.getCertificateListRef().push_back(
         toWidgetCertificateData(data, true));
-    m_contextData.wacSecurity.getCertificateListRef().push_back(
+    m_contextData.widgetSecurity.getCertificateListRef().push_back(
         toWidgetCertificateData(data, false));
 
     // match widget_id with one from dns identity set
@@ -186,12 +187,12 @@ void TaskCertify::processAuthorSignature(const SignatureData &data)
            "Certificate collection is not able to create chain. "
            "It is not possible to verify this signature.");
 
-    m_contextData.wacSecurity.getAuthorsCertificateChainListRef().push_back(
+    m_contextData.widgetSecurity.getAuthorsCertificateChainListRef().push_back(
         collection);
 
     FOREACH(it, dnsIdentity){
         if (widgetId.matchHost(*it)) {
-            m_contextData.wacSecurity.setRecognized(true);
+            m_contextData.widgetSecurity.setRecognized(true);
             return;
         }
     }
@@ -211,7 +212,7 @@ void TaskCertify::getSignatureFiles(std::string path, SignatureFileInfoSet& file
 
 void TaskCertify::stepSignature()
 {
-    LogInfo("================ Step: <<Signature>> ENTER ===============");
+    LogDebug("================ Step: <<Signature>> ENTER ===============");
 
     std::string widgetPath;
     widgetPath = m_contextData.locations->getTemporaryPackageDir() + "/";
@@ -239,12 +240,10 @@ void TaskCertify::stepSignature()
     }
 
     SignatureFileInfoSet::reverse_iterator iter = signatureFiles.rbegin();
-    LogInfo("Number of signatures: " << signatureFiles.size());
-
-    bool complianceMode = GlobalDAOReadOnly::getComplianceMode();
+    LogDebug("Number of signatures: " << signatureFiles.size());
 
     for (; iter != signatureFiles.rend(); ++iter) {
-        LogInfo("Checking signature with id=" << iter->getFileNumber());
+        LogDebug("Checking signature with id=" << iter->getFileNumber());
         SignatureData data(widgetPath + iter->getFileName(),
                            iter->getFileNumber());
 
@@ -253,24 +252,15 @@ void TaskCertify::stepSignature()
             xml.initialize(data, GlobalConfig::GetSignatureXmlSchema());
             xml.read(data);
 
-            WrtSignatureValidator::AppType appType =
-                WrtSignatureValidator::WAC20;
-
-            if (m_contextData.widgetConfig.webAppType ==
-                APP_TYPE_TIZENWEBAPP)
-            {
-                appType = WrtSignatureValidator::TIZEN;
-            }
-
             WrtSignatureValidator::Result result;
 
             WrtSignatureValidator validator(
-                    appType,
+                    WrtSignatureValidator::TIZEN,
                     !GlobalSettings::
                     OCSPTestModeEnabled(),
                     !GlobalSettings::
                     CrlTestModeEnabled(),
-                    complianceMode);
+                    false);
 
             result = validator.check(data, widgetPath);
 
@@ -311,25 +301,16 @@ void TaskCertify::stepSignature()
     }
 
     if (signatureFiles.empty()) {
-        LogInfo("No signature files has been found.");
+        LogDebug("No signature files has been found.");
     }
 
-    LogInfo("================ Step: <<Signature>> DONE ================");
+    LogDebug("================ Step: <<Signature>> DONE ================");
 
     m_contextData.job->UpdateProgress(
         InstallerContext::INSTALL_DIGSIG_CHECK,
         "Widget Signature checked");
 }
 
-void TaskCertify::stepFinalize()
-{
-    LogInfo("Step: <<CERTYFYING DONE>>");
-
-    m_contextData.job->UpdateProgress(
-        InstallerContext::INSTALL_CERT_CHECK,
-        "Widget Certification Check Finished");
-}
-
 bool TaskCertify::isTizenWebApp() const
 {
     bool ret = FALSE;
@@ -344,9 +325,9 @@ bool TaskCertify::isTizenWebApp() const
 
 void TaskCertify::stepVerifyUpdate()
 {
-    LogInfo("Step: <<Check Update>>");
+    LogDebug("Step: <<Check Update>>");
     CertificatePtr newCertificate =
-        m_contextData.wacSecurity.getAuthorCertificatePtr();
+        m_contextData.widgetSecurity.getAuthorCertificatePtr();
     CertificatePtr oldCertificate =
         getOldAuthorSignerCertificate(m_contextData.widgetConfig.tzAppid);
 
@@ -368,6 +349,22 @@ void TaskCertify::stepVerifyUpdate()
         }
     }
 }
+
+void TaskCertify::StartStep()
+{
+    LogDebug("--------- <TaskCertify> : START ----------");
+}
+
+void TaskCertify::EndStep()
+{
+    LogDebug("Step: <<CERTYFYING DONE>>");
+
+    m_contextData.job->UpdateProgress(
+        InstallerContext::INSTALL_CERT_CHECK,
+        "Widget Certification Check Finished");
+
+    LogDebug("--------- <TaskCertify> : END ----------");
+}
 } //namespace WidgetInstall
 } //namespace Jobs