IWacSecurity interface name change to IWidgetSecurity
authorTomasz Iwanek <t.iwanek@samsung.com>
Wed, 10 Jul 2013 10:46:15 +0000 (12:46 +0200)
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>
Tue, 16 Jul 2013 11:48:08 +0000 (11:48 +0000)
[Issue#]       LINUXWRT-629
[Bug]          Irrelevant name
[Cause]        N/A
[Solution]     N/A
[Verification] Build repository:
[SCMRequest]   This change depends on: https://review.tizendev.org/#/c/80379

Change-Id: I1b52a267b6ba450376b91c872b97e64b64760871

src/CMakeLists.txt
src/jobs/widget_install/task_certificates.cpp
src/jobs/widget_install/task_certify.cpp
src/jobs/widget_install/task_database.cpp
src/jobs/widget_install/task_smack.cpp
src/jobs/widget_install/widget_install_context.h
src/jobs/widget_install/widget_security.cpp [moved from src/jobs/widget_install/wac_security.cpp with 92% similarity]
src/jobs/widget_install/widget_security.h [moved from src/jobs/widget_install/wac_security.h with 92% similarity]

index 724787d..d842af9 100644 (file)
@@ -78,7 +78,7 @@ SET(INSTALLER_SOURCES
     ${INSTALLER_JOBS}/widget_install/task_encrypt_resource.cpp
     ${INSTALLER_JOBS}/widget_install/task_certificates.cpp
     ${INSTALLER_JOBS}/widget_install/task_prepare_reinstall.cpp
-    ${INSTALLER_JOBS}/widget_install/wac_security.cpp
+    ${INSTALLER_JOBS}/widget_install/widget_security.cpp
     ${INSTALLER_JOBS}/widget_install/widget_update_info.cpp
     ${INSTALLER_JOBS}/widget_install/directory_api.cpp
     ${INSTALLER_JOBS}/widget_install/widget_unzip.cpp
index a6693bc..cf4afd3 100644 (file)
@@ -84,7 +84,7 @@ void TaskCertificates::SetCertiInfo(CertificateSource source)
 {
     LogDebug("Set CertiInfo to pkgmgr : " << source);
     CertificateChainList certificateChainList;
-    m_context.wacSecurity.getCertificateChainList(certificateChainList, source);
+    m_context.widgetSecurity.getCertificateChainList(certificateChainList, source);
 
     FOREACH(it, certificateChainList)
     {
index e5d1533..a440a6d 100644 (file)
@@ -137,7 +137,7 @@ 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 +148,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));
     }
 }
@@ -164,12 +164,12 @@ void TaskCertify::processAuthorSignature(const SignatureData &data)
     using namespace ValidationCore;
     LogInfo("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 +186,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;
         }
     }
@@ -335,7 +335,7 @@ void TaskCertify::stepVerifyUpdate()
 {
     LogInfo("Step: <<Check Update>>");
     CertificatePtr newCertificate =
-        m_contextData.wacSecurity.getAuthorCertificatePtr();
+        m_contextData.widgetSecurity.getAuthorCertificatePtr();
     CertificatePtr oldCertificate =
         getOldAuthorSignerCertificate(m_contextData.widgetConfig.tzAppid);
 
index 29fda9a..26b82a1 100644 (file)
@@ -96,7 +96,7 @@ void TaskDatabase::StepWrtDBInsert()
                 m_backAppId,
                 m_context.widgetConfig.tzAppid,
                 m_context.widgetConfig,
-                m_context.wacSecurity);
+                m_context.widgetSecurity);
             m_handle = WidgetDAOReadOnly::getHandle(
                     m_context.widgetConfig.tzAppid);
         } else { //new installation
@@ -104,7 +104,7 @@ void TaskDatabase::StepWrtDBInsert()
             WidgetDAO::registerWidget(
                 m_context.widgetConfig.tzAppid,
                 m_context.widgetConfig,
-                m_context.wacSecurity);
+                m_context.widgetSecurity);
             m_handle = WidgetDAOReadOnly::getHandle(
                     m_context.widgetConfig.tzAppid);
         }
@@ -144,7 +144,7 @@ void TaskDatabase::StepAceDBInsert()
     }
 
     if (!AceApi::registerAceWidget(m_handle, m_context.widgetConfig,
-                                   m_context.wacSecurity.getCertificateList()))
+                                   m_context.widgetSecurity.getCertificateList()))
     {
         LogError("ace database insert failed");
         ThrowMsg(Exceptions::UpdateFailed,
index 9b99814..73272db 100644 (file)
@@ -247,7 +247,7 @@ bool TaskSmack::setLabelForSharedDir(const char* pkgId)
     }
 
     /* /shared/trusted directory */
-    CertificatePtr rootCert = m_context.wacSecurity.getAuthorCertificatePtr();
+    CertificatePtr rootCert = m_context.widgetSecurity.getAuthorCertificatePtr();
     if (rootCert.Get() != NULL) {
         ValidationCore::Crypto::Hash::SHA1 sha1;
         sha1.Append(rootCert->getDER());
index a19f3bb..0317c0d 100644 (file)
@@ -26,7 +26,7 @@
 #include <string>
 #include <dpl/string.h>
 #include <dpl/wrt-dao-rw/widget_dao.h>
-#include <widget_install/wac_security.h>
+#include <widget_install/widget_security.h>
 #include <feature_logic.h>
 #include <widget_install/widget_update_info.h>
 #include <widget_location.h>
@@ -78,7 +78,7 @@ struct InstallerContext
     // Installation state variables
     WrtDB::WidgetRegisterInfo widgetConfig;      ///< WidgetConfigInfo
     DPL::Optional<WidgetLocation> locations;
-    Jobs::WidgetInstall::WacSecurity wacSecurity; ///< Widget Domain
+    Jobs::WidgetInstall::WidgetSecurity widgetSecurity; ///< Widget Domain
                                                   // information.
     InstallStep installStep;              ///< current step of installation
     Jobs::WidgetInstall::JobWidgetInstall *job;
similarity index 92%
rename from src/jobs/widget_install/wac_security.cpp
rename to src/jobs/widget_install/widget_security.cpp
index 447a99f..01644ab 100644 (file)
  *    limitations under the License.
  */
 /*
- * @file    wac_security.cpp
+ * @file    widget_security.cpp
  * @author  Krzysztof Jackiewicz(k.jackiewicz@samsung.com)
  * @version 1.0
  * @brief
  */
 
-#include "wac_security.h"
+#include "widget_security.h"
 #include <dpl/foreach.h>
 
 namespace Jobs {
 namespace WidgetInstall {
-void WacSecurity::getCertificateChainList(
+void WidgetSecurity::getCertificateChainList(
     WrtDB::CertificateChainList& list,
     WrtDB::CertificateSource source) const
 {
similarity index 92%
rename from src/jobs/widget_install/wac_security.h
rename to src/jobs/widget_install/widget_security.h
index 8306f75..0bc04ef 100644 (file)
@@ -14,7 +14,7 @@
  *    limitations under the License.
  */
 /*
- * @file    wac_security.h
+ * @file    widget_security.h
  * @author  Krzysztof Jackiewicz(k.jackiewicz@samsung.com)
  * @version 1.0
  * @brief
 
 namespace Jobs {
 namespace WidgetInstall {
-class WacSecurity : public WrtDB::IWacSecurity
+class WidgetSecurity : public WrtDB::IWidgetSecurity
 {
   public:
-    WacSecurity() :
+    WidgetSecurity() :
         mRecognized(false),
         mDistributorSigned(false)
     {}
 
-    // from IWacSecurity
+    // from IWidgetSecurity
     virtual const WrtDB::WidgetCertificateDataList& getCertificateList() const
     {
         return mCertificateList;
@@ -53,12 +53,6 @@ class WacSecurity : public WrtDB::IWacSecurity
         return mDistributorSigned;
     }
 
-    // TODO : remove after wrt-commons released
-    virtual bool isWacSigned() const
-    {
-        return false;
-    }
-
     virtual void getCertificateChainList(
         WrtDB::CertificateChainList& list,
         WrtDB::CertificateSource source) const;