StepTpkRecoverSignature 98/84598/2 accepted/tizen/common/20160829.135942 accepted/tizen/common/20160830.150151 accepted/tizen/ivi/20160830.061219 accepted/tizen/mobile/20160830.060943 accepted/tizen/tv/20160830.061048 accepted/tizen/wearable/20160830.061133 submit/tizen/20160829.010716 submit/tizen/20160830.010724
authorTomasz Iwanek <t.iwanek@samsung.com>
Fri, 19 Aug 2016 10:28:17 +0000 (12:28 +0200)
committerTomasz Iwanek <t.iwanek@samsung.com>
Fri, 19 Aug 2016 10:50:51 +0000 (12:50 +0200)
To verify, run test:
 app_fw$ /usr/bin/tpk-backend-ut/smoke-test --gtest_filter=SmokeTest.RecoveryMode_Tpk_Update

Requires:
 - https://review.tizen.org/gerrit/84596

Change-Id: Ia6190c712fd89ef63d89d6d32f4b67b8f83813d2

src/tpk/CMakeLists.txt
src/tpk/step/security/step_tpk_recover_signature.cc [new file with mode: 0644]
src/tpk/step/security/step_tpk_recover_signature.h [new file with mode: 0644]
src/tpk/tpk_installer.cc

index 646a52f1221655ab0da8e18315aab0d47c065101..b818d1b660c3949b4319ad6bb6c5df363aee8177 100644 (file)
@@ -14,6 +14,7 @@ SET(SRCS
   step/pkgmgr/step_manifest_adjustment.cc
   step/rds/step_tpk_rds_modify.cc
   step/security/step_check_tpk_background_category.cc
+  step/security/step_tpk_recover_signature.cc
   tpk_app_query_interface.cc
   tpk_mount_path.cc
   tpk_installer.cc
diff --git a/src/tpk/step/security/step_tpk_recover_signature.cc b/src/tpk/step/security/step_tpk_recover_signature.cc
new file mode 100644 (file)
index 0000000..6a8623e
--- /dev/null
@@ -0,0 +1,17 @@
+// Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache 2.0 license that can be
+// found in the LICENSE file.
+
+#include "tpk/step/security/step_tpk_recover_signature.h"
+
+namespace bf = boost::filesystem;
+
+namespace tpk {
+namespace security {
+
+bf::path StepTpkRecoverSignature::GetSignatureRoot() {
+  return context_->pkg_path.get();
+}
+
+}  // namespace security
+}  // namespace tpk
diff --git a/src/tpk/step/security/step_tpk_recover_signature.h b/src/tpk/step/security/step_tpk_recover_signature.h
new file mode 100644 (file)
index 0000000..bf97c17
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache 2.0 license that can be
+// found in the LICENSE file.
+
+#ifndef TPK_STEP_SECURITY_STEP_TPK_RECOVER_SIGNATURE_H_
+#define TPK_STEP_SECURITY_STEP_TPK_RECOVER_SIGNATURE_H_
+
+#ifndef TPK_BACKEND_EXPORT_API
+#define TPK_BACKEND_EXPORT_API
+#endif
+
+#include <common/step/security/step_recover_signature.h>
+
+#include <boost/filesystem/path.hpp>
+
+namespace tpk {
+namespace security {
+
+class TPK_BACKEND_EXPORT_API StepTpkRecoverSignature
+    : public common_installer::security::StepRecoverSignature {
+ public:
+  using StepRecoverSignature::StepRecoverSignature;
+
+ private:
+  boost::filesystem::path GetSignatureRoot() override;
+};
+
+}  // namespace security
+}  // namespace tpk
+
+#endif  // TPK_STEP_SECURITY_STEP_TPK_RECOVER_SIGNATURE_H_
index d86a752f4b2d10d8ef3c6e5046a9b0fa3d3f235a..13da9db4b7456fbd11bcd6e9b034d509a89cc233 100644 (file)
@@ -78,6 +78,7 @@
 #include "tpk/step/pkgmgr/step_manifest_adjustment.h"
 #include "tpk/step/rds/step_tpk_rds_modify.h"
 #include "tpk/step/security/step_check_tpk_background_category.h"
+#include "tpk/step/security/step_tpk_recover_signature.h"
 
 namespace ci = common_installer;
 
@@ -341,13 +342,14 @@ void TpkInstaller::RecoverySteps() {
   AddStep<ci::configuration::StepParseManifest>(
       ci::configuration::StepParseManifest::ManifestLocation::RECOVERY,
       ci::configuration::StepParseManifest::StoreLocation::NORMAL);
-  AddStep<ci::pkgmgr::StepRecoverApplication>();
   AddStep<ci::filesystem::StepRemoveTemporaryDirectory>();
   AddStep<ci::filesystem::StepRecoverIcons>();
   AddStep<ci::filesystem::StepRecoverManifest>();
   AddStep<ci::filesystem::StepRecoverExternalStorage>();
   AddStep<ci::filesystem::StepRecoverStorageDirectories>();
   AddStep<ci::filesystem::StepRecoverFiles>();
+  AddStep<tpk::security::StepTpkRecoverSignature>();
+  AddStep<ci::pkgmgr::StepRecoverApplication>();
   AddStep<ci::security::StepRecoverSecurity>();
 }