| Index: components/sync/base/nigori.cc
|
| diff --git a/components/sync/base/nigori.cc b/components/sync/base/nigori.cc
|
| index e87e96ccfccf1872eed11b042b1c58bf7f6dad06..03c61b23472a34410579a40e987186db3bcde1d8 100644
|
| --- a/components/sync/base/nigori.cc
|
| +++ b/components/sync/base/nigori.cc
|
| @@ -79,12 +79,6 @@
|
| if (!user_salt->GetRawKey(&raw_user_salt))
|
| return false;
|
|
|
| - // Kuser = PBKDF2(P, Suser, Nuser, 16)
|
| - user_key_ = SymmetricKey::DeriveKeyFromPassword(
|
| - SymmetricKey::AES, password, raw_user_salt, kUserIterations,
|
| - kDerivedKeySizeInBits);
|
| - DCHECK(user_key_);
|
| -
|
| // Kenc = PBKDF2(P, Suser, Nenc, 16)
|
| encryption_key_ = SymmetricKey::DeriveKeyFromPassword(
|
| SymmetricKey::AES, password, raw_user_salt, kEncryptionIterations,
|
| @@ -97,14 +91,11 @@
|
| kDerivedKeySizeInBits);
|
| DCHECK(mac_key_);
|
|
|
| - return user_key_ && encryption_key_ && mac_key_;
|
| -}
|
| -
|
| -bool Nigori::InitByImport(const std::string& user_key,
|
| - const std::string& encryption_key,
|
| + return encryption_key_ && mac_key_;
|
| +}
|
| +
|
| +bool Nigori::InitByImport(const std::string& encryption_key,
|
| const std::string& mac_key) {
|
| - user_key_ = SymmetricKey::Import(SymmetricKey::AES, user_key);
|
| -
|
| encryption_key_ = SymmetricKey::Import(SymmetricKey::AES, encryption_key);
|
| DCHECK(encryption_key_);
|
|
|
| @@ -232,14 +223,11 @@
|
| return true;
|
| }
|
|
|
| -bool Nigori::ExportKeys(std::string* user_key,
|
| - std::string* encryption_key,
|
| +bool Nigori::ExportKeys(std::string* encryption_key,
|
| std::string* mac_key) const {
|
| DCHECK(encryption_key);
|
| DCHECK(mac_key);
|
|
|
| - user_key_->GetRawKey(user_key);
|
| -
|
| return encryption_key_->GetRawKey(encryption_key) &&
|
| mac_key_->GetRawKey(mac_key);
|
| }
|
|
|