aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYabin Cui2016-06-09 16:09:39 -0500
committerTao Bao2016-10-19 13:19:15 -0500
commitfd99a318fe630b49ba35f9a19a1866e8b1a42b7e (patch)
tree53388e66db91793598030067dea27790a7f2c0de /install.h
parent06603c76c5c2424a6e6fc11326856a75e28bb616 (diff)
downloadplatform-bootable-recovery-fd99a318fe630b49ba35f9a19a1866e8b1a42b7e.tar.gz
platform-bootable-recovery-fd99a318fe630b49ba35f9a19a1866e8b1a42b7e.tar.xz
platform-bootable-recovery-fd99a318fe630b49ba35f9a19a1866e8b1a42b7e.zip
Verify wipe package when wiping A/B device in recovery.
To increase the security of wiping A/B devices, let uncrypt write wipe package in misc partition. Then recovery verifies the wipe package before wiping the device. Based on the original cherrypick, this CL also has additional changes to address the LOG statements and libziparchive changes. Bug: 29159185 Test: Build and boot into recovery. Change-Id: I186691bab1928d3dc036bc5542abd64a81bc2168 (cherry picked from commit 6faf0265c9b58db2c15b53f6d29025629d52f882)
Diffstat (limited to 'install.h')
-rw-r--r--install.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/install.h b/install.h
index 66764f54..7f66a51c 100644
--- a/install.h
+++ b/install.h
@@ -17,11 +17,10 @@
17#ifndef RECOVERY_INSTALL_H_ 17#ifndef RECOVERY_INSTALL_H_
18#define RECOVERY_INSTALL_H_ 18#define RECOVERY_INSTALL_H_
19 19
20#include "common.h" 20#include <string>
21#include <ziparchive/zip_archive.h>
21 22
22#ifdef __cplusplus 23#include "common.h"
23extern "C" {
24#endif
25 24
26enum { INSTALL_SUCCESS, INSTALL_ERROR, INSTALL_CORRUPT, INSTALL_NONE, INSTALL_SKIPPED, 25enum { INSTALL_SUCCESS, INSTALL_ERROR, INSTALL_CORRUPT, INSTALL_NONE, INSTALL_SKIPPED,
27 INSTALL_RETRY }; 26 INSTALL_RETRY };
@@ -31,8 +30,12 @@ enum { INSTALL_SUCCESS, INSTALL_ERROR, INSTALL_CORRUPT, INSTALL_NONE, INSTALL_SK
31int install_package(const char* root_path, bool* wipe_cache, const char* install_file, 30int install_package(const char* root_path, bool* wipe_cache, const char* install_file,
32 bool needs_mount, int retry_count); 31 bool needs_mount, int retry_count);
33 32
34#ifdef __cplusplus 33// Verify the package by ota keys. Return true if the package is verified successfully,
35} 34// otherwise return false.
36#endif 35bool verify_package(const unsigned char* package_data, size_t package_size);
36
37// Read meta data file of the package, write its content in the string pointed by meta_data.
38// Return true if succeed, otherwise return false.
39bool read_metadata_from_package(ZipArchiveHandle zip, std::string* meta_data);
37 40
38#endif // RECOVERY_INSTALL_H_ 41#endif // RECOVERY_INSTALL_H_