Add StepRevokeTrustAnchor steps for several installation cases. 66/194366/1
authorJunghyun Yeon <jungh.yeon@samsung.com>
Mon, 11 Dec 2017 02:11:47 +0000 (11:11 +0900)
committerSangyoon Jang <jeremy.jang@samsung.com>
Mon, 3 Dec 2018 12:03:00 +0000 (21:03 +0900)
- When updating pkg has failed, trust anchor should be revoked.

Related changes:
[app-installers] : https://review.tizen.org/gerrit/#/c/158351/

Change-Id: Ifaf443083b8ba4b3130cc6db3d145f7e5386e334
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
src/wgt/wgt_installer.cc

index f74f8dd..0b0fd63 100755 (executable)
@@ -82,6 +82,7 @@
 #include <common/step/security/step_rollback_installation_security.h>
 #include <common/step/security/step_update_security.h>
 #include <common/step/security/step_register_trust_anchor.h>
+#include <common/step/security/step_revoke_trust_anchor.h>
 #include <common/step/security/step_save_signature.h>
 #include <common/step/security/step_unregister_trust_anchor.h>
 
@@ -278,6 +279,7 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr)
       AddStep<ci::backup::StepBackupIcons>();
       AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
       AddStep<ci::filesystem::StepAcquireExternalStorage>(true);
+      AddStep<ci::security::StepRevokeTrustAnchor>();
       AddStep<ci::backup::StepCopyBackup>();
       AddStep<ci::filesystem::StepUpdateTep>();
       AddStep<ci::filesystem::StepUpdateStorageDirectories>();
@@ -346,6 +348,7 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr)
           ci::configuration::StepParseManifest::StoreLocation::BACKUP);
       AddStep<ci::configuration::StepBlockCrossUpdate>();
       AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
+      AddStep<ci::security::StepRevokeTrustAnchor>();
       AddStep<ci::rds::StepRDSParse>();
       AddStep<ci::filesystem::StepUpdateTep>();
       AddStep<ci::rds::StepRDSModify>();
@@ -392,6 +395,7 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr)
       AddStep<ci::backup::StepBackupIcons>();
       AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
       AddStep<ci::filesystem::StepAcquireExternalStorage>(true);
+      AddStep<ci::security::StepRevokeTrustAnchor>();
       AddStep<ci::backup::StepCopyBackup>();
       AddStep<ci::filesystem::StepUpdateTep>();
       AddStep<ci::filesystem::StepUpdateStorageDirectories>();
@@ -437,6 +441,9 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr)
       AddStep<ci::filesystem::StepRecoverChangeOwner>();
       AddStep<ci::security::StepRecoverSecurity>();
       AddStep<ci::pkgmgr::StepRecoverApplication>();
+      AddStep<ci::security::StepRegisterTrustAnchor>(
+          ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE);
+
   }
 
   void WgtInstaller::MountInstallSteps() {
@@ -506,6 +513,7 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr)
           ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
           ci::configuration::StepParseManifest::StoreLocation::BACKUP);
       AddStep<ci::configuration::StepBlockCrossUpdate>();
+      AddStep<ci::security::StepRevokeTrustAnchor>();
       AddStep<ci::pkgmgr::StepKillApps>();
       AddStep<ci::backup::StepBackupManifest>();
       AddStep<ci::backup::StepBackupIcons>();
@@ -671,6 +679,7 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr)
       AddStep<ci::filesystem::StepRemoveZipImage>();
       AddStep<ci::pkgmgr::StepUpdateApplication>();
       AddStep<ci::configuration::StepSwitchReadonlyMode>();
+      AddStep<ci::security::StepRevokeTrustAnchor>();
       AddStep<ci::security::StepRegisterTrustAnchor>(
           ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE);
       AddStep<ci::security::StepPrivacyPrivilege>(