| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 // | 4 // |
| 5 // Common sync protocol for encrypted data. | 5 // Common sync protocol for encrypted data. |
| 6 | 6 |
| 7 syntax = "proto2"; | 7 syntax = "proto2"; |
| 8 | 8 |
| 9 // TODO(akalin): Re-enable this once LITE_RUNTIME supports preserving | 9 // TODO(akalin): Re-enable this once LITE_RUNTIME supports preserving |
| 10 // unknown fields. | 10 // unknown fields. |
| 11 | 11 |
| 12 // option optimize_for = LITE_RUNTIME; | 12 // option optimize_for = LITE_RUNTIME; |
| 13 | 13 |
| 14 package sync_pb; | 14 package sync_pb; |
| 15 | 15 |
| 16 // Encrypted sync data consists of two parts: a key name and a blob. Key name is | 16 // Encrypted sync data consists of two parts: a key name and a blob. Key name is |
| 17 // the name of the key that was used to encrypt blob and blob is encrypted data | 17 // the name of the key that was used to encrypt blob and blob is encrypted data |
| 18 // itself. | 18 // itself. |
| 19 // | 19 // |
| 20 // The reason we need to keep track of the key name is that a sync user can | 20 // The reason we need to keep track of the key name is that a sync user can |
| 21 // change their passphrase (and thus their encryption key) at any time. When | 21 // change their passphrase (and thus their encryption key) at any time. When |
| 22 // that happens, we make a best effort to reencrypt all nodes with the new | 22 // that happens, we make a best effort to reencrypt all nodes with the new |
| 23 // passphrase, but since we don't have transactions on the server-side, we | 23 // passphrase, but since we don't have transactions on the server-side, we |
| 24 // cannot garantee that every node will be reencrypted. As a workaround, we keep | 24 // cannot guarantee that every node will be reencrypted. As a workaround, we |
| 25 // track of all keys, assign each key a name (by using that key to encrypt a | 25 // keep track of all keys, assign each key a name (by using that key to encrypt |
| 26 // well known string) and keep track of which key was used to encrypt each node. | 26 // a well known string) and keep track of which key was used to encrypt each |
| 27 // node. |
| 27 message EncryptedData { | 28 message EncryptedData { |
| 28 optional string key_name = 1; | 29 optional string key_name = 1; |
| 29 optional string blob = 2; | 30 optional string blob = 2; |
| 30 }; | 31 }; |
| OLD | NEW |