OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 #include "components/sync/engine_impl/sync_encryption_handler_impl.h" | 5 #include "components/sync/engine_impl/sync_encryption_handler_impl.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
528 | 528 |
529 // Data for testing encryption/decryption. | 529 // Data for testing encryption/decryption. |
530 Cryptographer other_cryptographer(GetCryptographer()->encryptor()); | 530 Cryptographer other_cryptographer(GetCryptographer()->encryptor()); |
531 other_cryptographer.AddKey(old_key); | 531 other_cryptographer.AddKey(old_key); |
532 sync_pb::EntitySpecifics other_encrypted_specifics; | 532 sync_pb::EntitySpecifics other_encrypted_specifics; |
533 other_encrypted_specifics.mutable_bookmark()->set_title("title"); | 533 other_encrypted_specifics.mutable_bookmark()->set_title("title"); |
534 other_cryptographer.Encrypt(other_encrypted_specifics, | 534 other_cryptographer.Encrypt(other_encrypted_specifics, |
535 other_encrypted_specifics.mutable_encrypted()); | 535 other_encrypted_specifics.mutable_encrypted()); |
536 sync_pb::EntitySpecifics our_encrypted_specifics; | 536 sync_pb::EntitySpecifics our_encrypted_specifics; |
537 our_encrypted_specifics.mutable_bookmark()->set_title("title2"); | 537 our_encrypted_specifics.mutable_bookmark()->set_title("title2"); |
538 ModelTypeSet encrypted_types = EncryptableUserTypes(); | |
539 | 538 |
540 // Set up the current encryption state (containing both keys and encrypt | 539 // Set up the current encryption state (containing both keys and encrypt |
541 // everything). | 540 // everything). |
542 sync_pb::NigoriSpecifics current_nigori_specifics; | 541 sync_pb::NigoriSpecifics current_nigori_specifics; |
543 GetCryptographer()->AddKey(old_key); | 542 GetCryptographer()->AddKey(old_key); |
544 GetCryptographer()->AddKey(current_key); | 543 GetCryptographer()->AddKey(current_key); |
545 GetCryptographer()->Encrypt(our_encrypted_specifics, | 544 GetCryptographer()->Encrypt(our_encrypted_specifics, |
546 our_encrypted_specifics.mutable_encrypted()); | 545 our_encrypted_specifics.mutable_encrypted()); |
547 GetCryptographer()->GetKeys( | 546 GetCryptographer()->GetKeys( |
548 current_nigori_specifics.mutable_encryption_keybag()); | 547 current_nigori_specifics.mutable_encryption_keybag()); |
(...skipping 1749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2298 EXPECT_CALL(*observer(), | 2297 EXPECT_CALL(*observer(), |
2299 OnBootstrapTokenUpdated(_, KEYSTORE_BOOTSTRAP_TOKEN)); | 2298 OnBootstrapTokenUpdated(_, KEYSTORE_BOOTSTRAP_TOKEN)); |
2300 { | 2299 { |
2301 ReadTransaction trans(FROM_HERE, user_share()); | 2300 ReadTransaction trans(FROM_HERE, user_share()); |
2302 encryption_handler()->SetKeystoreKeys( | 2301 encryption_handler()->SetKeystoreKeys( |
2303 BuildEncryptionKeyProto(kRawKeystoreKey), trans.GetWrappedTrans()); | 2302 BuildEncryptionKeyProto(kRawKeystoreKey), trans.GetWrappedTrans()); |
2304 } | 2303 } |
2305 } | 2304 } |
2306 | 2305 |
2307 } // namespace syncer | 2306 } // namespace syncer |
OLD | NEW |