// Copyright 2012 The Chromium Authors // 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. // If you change or add any fields in this file, update proto_visitors.h and // potentially proto_enum_conversions.{h, cc}. syntax = "proto2"; option go_package = "./sync_pb"; option java_multiple_files = true; option java_package = "org.chromium.components.sync.protocol"; option optimize_for = LITE_RUNTIME; package sync_pb; import "encryption.proto"; message NigoriKey { // Note that M78 and before rely on the name being populated, at least for // the main encrypted keybag within NigoriSpecifics. optional string deprecated_name = 1 [deprecated = true]; optional bytes deprecated_user_key = 2 [deprecated = true]; optional bytes encryption_key = 3; optional bytes mac_key = 4; } message CrossUserSharingPrivateKey { // The key version, used for key rotation. optional int32 version = 1; // Private key on Curve25519 (32 bytes). optional bytes x25519_private_key = 2; } message CrossUserSharingPublicKey { // The key version, used for key rotation and consensus. optional int32 version = 1; // Public key on Curve25519 (32 bytes). optional bytes x25519_public_key = 2; } message EncryptionKeys { // Used for encrypting data in the user's account. repeated NigoriKey key = 2; // Used for encrypting/authenticating using Public-private cryptography // primarily across user accounts, e.g. sharing invitations. repeated CrossUserSharingPrivateKey cross_user_sharing_private_key = 3; } // Deprecated: use EncryptionKeys instead. message NigoriKeyBag { option deprecated = true; // Used for encrypting data in the user's account. repeated NigoriKey key = 2; } // Properties of nigori sync object. message NigoriSpecifics { // Encrypted proto of type EncryptionKeys. optional EncryptedData encryption_keybag = 1; // Once keystore migration is performed, we have to freeze the keybag so that // older clients (that don't support keystore encryption) do not attempt to // update the keybag. // Previously |using_explicit_passphrase|. optional bool keybag_is_frozen = 2; // Obsolete encryption fields. These were deprecated due to legacy versions // that understand their usage but did not perform encryption properly. reserved 3; reserved "deprecated_encrypt_bookmarks"; reserved 4; reserved "deprecated_encrypt_preferences"; reserved 5; reserved "deprecated_encrypt_autofill_profile"; reserved 6; reserved "deprecated_encrypt_autofill"; reserved 7; reserved "deprecated_encrypt_themes"; reserved 8; reserved "deprecated_encrypt_typed_urls"; reserved 9; reserved "deprecated_encrypt_extensions"; reserved 10; reserved "deprecated_encrypt_sessions"; reserved 11; reserved "deprecated_encrypt_apps"; reserved 12; reserved "deprecated_encrypt_search_engines"; // Booleans corresponding to whether a datatype should be encrypted. // Passwords and Wi-Fi configurations are always encrypted, so we don't need // a field here. History delete directives need to be consumable by the // server, and thus can't be encrypted. // USS clients don't read these values, datatypes are either always encrypted, // never encrypted or encrypted when |encrypt_everything| set to true. // TODO(crbug.com/1360022): complete deprecation of encrypt_* fields (replace // fields with reserved) once