| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // Various utility methods for nigori-based multi-type encryption. | 5 // Various utility methods for nigori-based multi-type encryption. |
| 6 | 6 |
| 7 #ifndef CHROME_BROWSER_SYNC_ENGINE_NIGORI_UTIL_H_ | 7 #ifndef CHROME_BROWSER_SYNC_ENGINE_NIGORI_UTIL_H_ |
| 8 #define CHROME_BROWSER_SYNC_ENGINE_NIGORI_UTIL_H_ | 8 #define CHROME_BROWSER_SYNC_ENGINE_NIGORI_UTIL_H_ |
| 9 #pragma once | 9 #pragma once |
| 10 | 10 |
| 11 #include "base/compiler_specific.h" |
| 11 #include "chrome/browser/sync/protocol/nigori_specifics.pb.h" | 12 #include "chrome/browser/sync/protocol/nigori_specifics.pb.h" |
| 12 #include "chrome/browser/sync/syncable/model_type.h" | 13 #include "chrome/browser/sync/syncable/model_type.h" |
| 13 | 14 |
| 14 namespace browser_sync { | 15 namespace browser_sync { |
| 15 class Cryptographer; | 16 class Cryptographer; |
| 16 } | 17 } |
| 17 | 18 |
| 18 namespace sync_pb { | 19 namespace sync_pb { |
| 19 class EntitySpecifics; | 20 class EntitySpecifics; |
| 20 } | 21 } |
| (...skipping 27 matching lines...) Expand all Loading... |
| 48 // otherwise. Note: this does not check that already encrypted entries are | 49 // otherwise. Note: this does not check that already encrypted entries are |
| 49 // encrypted with the proper key. | 50 // encrypted with the proper key. |
| 50 bool EntryNeedsEncryption(const ModelTypeSet& encrypted_types, | 51 bool EntryNeedsEncryption(const ModelTypeSet& encrypted_types, |
| 51 const Entry& entry); | 52 const Entry& entry); |
| 52 | 53 |
| 53 // Same as EntryNeedsEncryption, but looks at specifics. | 54 // Same as EntryNeedsEncryption, but looks at specifics. |
| 54 bool SpecificsNeedsEncryption(const ModelTypeSet& encrypted_types, | 55 bool SpecificsNeedsEncryption(const ModelTypeSet& encrypted_types, |
| 55 const sync_pb::EntitySpecifics& specifics); | 56 const sync_pb::EntitySpecifics& specifics); |
| 56 | 57 |
| 57 // Verifies all data of type |type| is encrypted appropriately. | 58 // Verifies all data of type |type| is encrypted appropriately. |
| 58 bool VerifyDataTypeEncryption(BaseTransaction* const trans, | 59 bool VerifyDataTypeEncryptionForTest( |
| 59 browser_sync::Cryptographer* cryptographer, | 60 BaseTransaction* const trans, |
| 60 ModelType type, | 61 browser_sync::Cryptographer* cryptographer, |
| 61 bool is_encrypted); | 62 ModelType type, |
| 63 bool is_encrypted) WARN_UNUSED_RESULT; |
| 62 | 64 |
| 63 } // namespace syncable | 65 } // namespace syncable |
| 64 | 66 |
| 65 #endif // CHROME_BROWSER_SYNC_ENGINE_NIGORI_UTIL_H_ | 67 #endif // CHROME_BROWSER_SYNC_ENGINE_NIGORI_UTIL_H_ |
| OLD | NEW |