| 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 option optimize_for = LITE_RUNTIME; | 9 // TODO(akalin): Re-enable this once LITE_RUNTIME supports preserving |
| 10 // unknown fields. |
| 11 |
| 12 // option optimize_for = LITE_RUNTIME; |
| 10 | 13 |
| 11 package sync_pb; | 14 package sync_pb; |
| 12 | 15 |
| 13 // 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 |
| 14 // 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 |
| 15 // itself. | 18 // itself. |
| 16 // | 19 // |
| 17 // 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 |
| 18 // 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 |
| 19 // 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 |
| 20 // 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 |
| 21 // cannot garantee that every node will be reencrypted. As a workaround, we keep | 24 // cannot garantee that every node will be reencrypted. As a workaround, we keep |
| 22 // track of all keys, assign each key a name (by using that key to encrypt a | 25 // track of all keys, assign each key a name (by using that key to encrypt a |
| 23 // well known string) and keep track of which key was used to encrypt each node. | 26 // well known string) and keep track of which key was used to encrypt each node. |
| 24 message EncryptedData { | 27 message EncryptedData { |
| 25 optional string key_name = 1; | 28 optional string key_name = 1; |
| 26 optional string blob = 2; | 29 optional string blob = 2; |
| 27 }; | 30 }; |
| OLD | NEW |