summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sync/protocol
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/sync/protocol')
-rw-r--r--chrome/browser/sync/protocol/encryption.proto27
-rw-r--r--chrome/browser/sync/protocol/nigori_specifics.proto35
-rwxr-xr-xchrome/browser/sync/protocol/sync_proto.gyp2
3 files changed, 64 insertions, 0 deletions
diff --git a/chrome/browser/sync/protocol/encryption.proto b/chrome/browser/sync/protocol/encryption.proto
new file mode 100644
index 0000000..a115957
--- /dev/null
+++ b/chrome/browser/sync/protocol/encryption.proto
@@ -0,0 +1,27 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+// Common sync protocol for encrypted data.
+
+syntax = "proto2";
+
+option optimize_for = LITE_RUNTIME;
+
+package sync_pb;
+
+// Encrypted sync data consists of two parts: a key name and a blob. Key name is
+// the name of the key that was used to encrypt blob and blob is encrypted data
+// itself.
+//
+// The reason we need to keep track of the key name is that a sync user can
+// change their passphrase (and thus their encryption key) at any time. When
+// that happens, we make a best effort to reencrypt all nodes with the new
+// passphrase, but since we don't have transactions on the server-side, we
+// cannot garantee that every node will be reencrypted. As a workaround, we keep
+// track of all keys, assign each key a name (by using that key to encrypt a
+// well known string) and keep track of which key was used to encrypt each node.
+message EncryptedData {
+ optional string key_name = 1;
+ optional string blob = 2;
+};
diff --git a/chrome/browser/sync/protocol/nigori_specifics.proto b/chrome/browser/sync/protocol/nigori_specifics.proto
new file mode 100644
index 0000000..386bb5a
--- /dev/null
+++ b/chrome/browser/sync/protocol/nigori_specifics.proto
@@ -0,0 +1,35 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+// Sync protocol datatype extension for nigori keys.
+
+syntax = "proto2";
+
+option optimize_for = LITE_RUNTIME;
+
+package sync_pb;
+
+import "encryption.proto";
+import "sync.proto";
+
+message NigoriKey {
+ optional string name = 1;
+ optional string hostname = 2;
+ optional string username = 3;
+ optional string password = 4;
+}
+
+message NigoriKeyBag {
+ repeated NigoriKey key = 2;
+}
+
+// Properties of nigori sync object.
+message NigoriSpecifics {
+ optional EncryptedData encrypted = 1;
+}
+
+extend EntitySpecifics {
+ optional NigoriSpecifics nigori = 47745;
+}
+
diff --git a/chrome/browser/sync/protocol/sync_proto.gyp b/chrome/browser/sync/protocol/sync_proto.gyp
index c80e7d2..e4cde74 100755
--- a/chrome/browser/sync/protocol/sync_proto.gyp
+++ b/chrome/browser/sync/protocol/sync_proto.gyp
@@ -14,9 +14,11 @@
'type': 'none',
'sources': [
'sync.proto',
+ 'encryption.proto',
'autofill_specifics.proto',
'bookmark_specifics.proto',
'extension_specifics.proto',
+ 'nigori_specifics.proto',
'password_specifics.proto',
'preference_specifics.proto',
'theme_specifics.proto',