aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYabin Cui2016-06-09 16:09:39 -0500
committerYabin Cui2016-06-20 20:18:02 -0500
commit6faf0265c9b58db2c15b53f6d29025629d52f882 (patch)
treefc2e067205a986071615f936e8ff7040e01520f5 /bootloader.h
parentdc1393d09bcc09ae246cd46b2248d9401605d0f5 (diff)
downloadplatform-bootable-recovery-6faf0265c9b58db2c15b53f6d29025629d52f882.tar.gz
platform-bootable-recovery-6faf0265c9b58db2c15b53f6d29025629d52f882.tar.xz
platform-bootable-recovery-6faf0265c9b58db2c15b53f6d29025629d52f882.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. Bug: 29159185 Change-Id: I186691bab1928d3dc036bc5542abd64a81bc2168
Diffstat (limited to 'bootloader.h')
-rw-r--r--bootloader.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/bootloader.h b/bootloader.h
index 742a4abf..88d54a5c 100644
--- a/bootloader.h
+++ b/bootloader.h
@@ -17,6 +17,17 @@
17#ifndef _RECOVERY_BOOTLOADER_H 17#ifndef _RECOVERY_BOOTLOADER_H
18#define _RECOVERY_BOOTLOADER_H 18#define _RECOVERY_BOOTLOADER_H
19 19
20#include <stddef.h>
21
22// Spaces used by misc partition are as below:
23// 0 - 2K Bootloader Message
24// 2K - 16K Used by Vendor's bootloader
25// 16K - 64K Used by uncrypt and recovery to store wipe_package for A/B devices
26// Note that these offsets are admitted by bootloader,recovery and uncrypt, so they
27// are not configurable without changing all of them.
28static const size_t BOOTLOADER_MESSAGE_OFFSET_IN_MISC = 0;
29static const size_t WIPE_PACKAGE_OFFSET_IN_MISC = 16 * 1024;
30
20/* Bootloader Message 31/* Bootloader Message
21 * 32 *
22 * This structure describes the content of a block in flash 33 * This structure describes the content of a block in flash
@@ -68,4 +79,11 @@ struct bootloader_message {
68int get_bootloader_message(struct bootloader_message *out); 79int get_bootloader_message(struct bootloader_message *out);
69int set_bootloader_message(const struct bootloader_message *in); 80int set_bootloader_message(const struct bootloader_message *in);
70 81
82#ifdef __cplusplus
83
84#include <string>
85
86bool read_wipe_package(size_t size, std::string* out);
87#endif
88
71#endif 89#endif