Index: components/sync/base/nigori.h |
diff --git a/components/sync/base/nigori.h b/components/sync/base/nigori.h |
index d0088c38ec13852649fdbb2107f2e227d8aac111..fe22f852f234adcf09f025ef0188ddb71815f796 100644 |
--- a/components/sync/base/nigori.h |
+++ b/components/sync/base/nigori.h |
@@ -41,7 +41,8 @@ class Nigori { |
// Initialize the client by importing the given keys instead of deriving new |
// ones. |
- bool InitByImport(const std::string& encryption_key, |
+ bool InitByImport(const std::string& user_key, |
+ const std::string& encryption_key, |
const std::string& mac_key); |
// Derives a secure lookup name from |type| and |name|. If |hostname|, |
@@ -59,7 +60,9 @@ class Nigori { |
bool Decrypt(const std::string& value, std::string* decrypted) const; |
// Exports the raw derived keys. |
- bool ExportKeys(std::string* encryption_key, std::string* mac_key) const; |
+ bool ExportKeys(std::string* user_key, |
+ std::string* encryption_key, |
+ std::string* mac_key) const; |
static const char kSaltSalt[]; // The salt used to derive the user salt. |
static const size_t kSaltKeySizeInBits = 128; |
@@ -68,10 +71,12 @@ class Nigori { |
static const size_t kHashSize = 32; |
static const size_t kSaltIterations = 1001; |
+ static const size_t kUserIterations = 1002; |
static const size_t kEncryptionIterations = 1003; |
static const size_t kSigningIterations = 1004; |
private: |
+ std::unique_ptr<crypto::SymmetricKey> user_key_; |
std::unique_ptr<crypto::SymmetricKey> encryption_key_; |
std::unique_ptr<crypto::SymmetricKey> mac_key_; |
}; |