summaryrefslogtreecommitdiff
path: root/packages/BackupEncryption/proto
diff options
context:
space:
mode:
authorAl Sutton <alsutton@google.com>2019-09-18 14:52:48 +0100
committerAl Sutton <alsutton@google.com>2019-09-23 10:26:27 +0100
commit668c05eb92d0d624a2c7eae9fc35c792a921a721 (patch)
tree8fe6d573c84706cc8ca5443a96ed5a22f6ea1889 /packages/BackupEncryption/proto
parente18cb098628a66c3c199f29af92f565f72534970 (diff)
Import the code related to Key/Value backup encryption
Bug: 111386661 Test: make RunBackupEncryptionRoboTests Change-Id: I6adaedf05034b6706a31a071f9ae0f04abc7b300
Diffstat (limited to 'packages/BackupEncryption/proto')
-rw-r--r--packages/BackupEncryption/proto/key_value_listing.proto40
-rw-r--r--packages/BackupEncryption/proto/key_value_pair.proto31
2 files changed, 71 insertions, 0 deletions
diff --git a/packages/BackupEncryption/proto/key_value_listing.proto b/packages/BackupEncryption/proto/key_value_listing.proto
new file mode 100644
index 000000000000..001e697bd804
--- /dev/null
+++ b/packages/BackupEncryption/proto/key_value_listing.proto
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+syntax = "proto2";
+
+package android_backup_crypto;
+
+option java_package = "com.android.server.backup.encryption.protos";
+option java_outer_classname = "KeyValueListingProto";
+
+// An entry of a key-value pair.
+message KeyValueEntry {
+ // Plaintext key of the key-value pair.
+ optional string key = 1;
+ // SHA-256 MAC of the plaintext of the chunk containing the pair
+ optional bytes hash = 2;
+}
+
+// Describes the key/value pairs currently in the backup blob, mapping from the
+// plaintext key to the hash of the chunk containing the pair.
+//
+// This is local state stored on the device. It is never sent to the
+// backup server. See ChunkOrdering for how the device restores the
+// key-value pairs in the correct order.
+message KeyValueListing {
+ repeated KeyValueEntry entries = 1;
+}
diff --git a/packages/BackupEncryption/proto/key_value_pair.proto b/packages/BackupEncryption/proto/key_value_pair.proto
new file mode 100644
index 000000000000..177fa3025dc8
--- /dev/null
+++ b/packages/BackupEncryption/proto/key_value_pair.proto
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+syntax = "proto2";
+
+package android_backup_crypto;
+
+option java_package = "com.android.server.backup.encryption.protos";
+option java_outer_classname = "KeyValuePairProto";
+
+// Serialized form of a key-value pair, when it is to be encrypted in a blob.
+// The backup blob for a key-value database consists of repeated encrypted
+// key-value pairs like this, in a randomized order. See ChunkOrdering for how
+// these are then reconstructed during a restore.
+message KeyValuePair {
+ optional string key = 1;
+ optional bytes value = 2;
+}